summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2023-11-07stmmac: add ethercat supportMinda Chen2-54/+188
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
2023-11-06tty/serial/pl011: Make the locking work on RTThomas Gleixner1-6/+11
The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and non-RT. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06tty/serial/omap: Make the locking RT awareThomas Gleixner1-8/+4
The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and non-RT. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06leds: trigger: Disable CPU trigger on PREEMPT_RTSebastian Andrzej Siewior1-0/+1
The CPU trigger is invoked on ARM from CPU-idle. That trigger later invokes led_trigger_event() which may invoke the callback of the actual driver. That driver can acquire a spinlock_t which is okay on kernel without PREEMPT_RT. On PREEMPT_RT enabled kernel this lock is turned into a sleeping lock and must not be acquired with disabled interrupts. Disable the CPU trigger on PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lkml.kernel.org/r/20210924111501.m57cwwn7ahiyxxdd@linutronix.de
2023-11-06drivers/block/zram: Replace bit spinlocks with rtmutex for -rtMike Galbraith2-0/+37
They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06tpm_tis: fix stall after iowrite*()sHaris Okanovic1-2/+27
ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. For example, cyclitest measures ~400us latency spikes when a non-RT usermode application communicates with an SPI-based TPM chip (Intel Atom E3940 system, PREEMPT_RT kernel). The spikes are caused by a stalling ioread8() operation following a sequence of 30+ iowrite8()s to the same address. I believe this happens because the write sequence is buffered (in cpu or somewhere along the bus), and gets flushed on the first LOAD instruction (ioread*()) that follows. The enclosed change appears to fix this issue: read the TPM chip's access register (status code) after every iowrite*() operation to amortize the cost of flushing data to chip across multiple instructions. Signed-off-by: Haris Okanovic <haris.okanovic@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06virt: acrn: Remove unsued acrn_irqfds_mutex.Sebastian Andrzej Siewior1-1/+0
acrn_irqfds_mutex is not used, never was. Remove acrn_irqfds_mutex. Fixes: aa3b483ff1d71 ("virt: acrn: Introduce irqfd") Cc: Fei Li <fei1.li@intel.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Drop the irqs_disabled() checkSebastian Andrzej Siewior1-2/+0
The !irqs_disabled() check triggers on PREEMPT_RT even with i915_sched_engine::lock acquired. The reason is the lock is transformed into a sleeping lock on PREEMPT_RT and does not disable interrupts. There is no need to check for disabled interrupts. The lockdep annotation below already check if the lock has been acquired by the caller and will yell if the interrupts are not disabled. Remove the !irqs_disabled() check. Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock()Sebastian Andrzej Siewior1-12/+5
execlists_dequeue() is invoked from a function which uses local_irq_disable() to disable interrupts so the spin_lock() behaves like spin_lock_irq(). This breaks PREEMPT_RT because local_irq_disable() + spin_lock() is not the same as spin_lock_irq(). execlists_dequeue_irq() and execlists_dequeue() has each one caller only. If intel_engine_cs::active::lock is acquired and released with the _irq suffix then it behaves almost as if execlists_dequeue() would be invoked with disabled interrupts. The difference is the last part of the function which is then invoked with enabled interrupts. I can't tell if this makes a difference. From looking at it, it might work to move the last unlock at the end of the function as I didn't find anything that would acquire the lock again. Reported-by: Clark Williams <williams@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2023-11-06drm/i915/gt: Queue and wait for the irq_work item.Sebastian Andrzej Siewior1-3/+2
Disabling interrupts and invoking the irq_work function directly breaks on PREEMPT_RT. PREEMPT_RT does not invoke all irq_work from hardirq context because some of the user have spinlock_t locking in the callback function. These locks are then turned into a sleeping locks which can not be acquired with disabled interrupts. Using irq_work_queue() has the benefit that the irqwork will be invoked in the regular context. In general there is "no" delay between enqueuing the callback and its invocation because the interrupt is raised right away on architectures which support it (which includes x86). Use irq_work_queue() + irq_work_sync() instead invoking the callback directly. Reported-by: Clark Williams <williams@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2023-11-06drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACESebastian Andrzej Siewior1-1/+1
The order of the header files is important. If this header file is included after tracepoint.h was included then the NOTRACE here becomes a nop. Currently this happens for two .c files which use the tracepoitns behind DRM_I915_LOW_LEVEL_TRACEPOINTS. Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06drm/i915: Disable tracing points on PREEMPT_RTSebastian Andrzej Siewior1-0/+4
Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 | CPU: 1 PID: 15203 Comm: kworker/u8:2 Not tainted 4.19.1-rt3 #10 | Call Trace: | rt_spin_lock+0x3f/0x50 | gen6_read32+0x45/0x1d0 [i915] | g4x_get_vblank_counter+0x36/0x40 [i915] | trace_event_raw_event_i915_pipe_update_start+0x7d/0xf0 [i915] The tracing events use trace_i915_pipe_update_start() among other events use functions acquire spinlock_t locks which are transformed into sleeping locks on PREEMPT_RT. A few trace points use intel_get_crtc_scanline(), others use ->get_vblank_counter() wich also might acquire a sleeping locks on PREEMPT_RT. At the time the arguments are evaluated within trace point, preemption is disabled and so the locks must not be acquired on PREEMPT_RT. Based on this I don't see any other way than disable trace points on PREMPT_RT. Reported-by: Luca Abeni <lucabe72@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Don't check for atomic context on PREEMPT_RTSebastian Andrzej Siewior1-1/+1
The !in_atomic() check in _wait_for_atomic() triggers on PREEMPT_RT because the uncore::lock is a spinlock_t and does not disable preemption or interrupts. Changing the uncore:lock to a raw_spinlock_t doubles the worst case latency on an otherwise idle testbox during testing. Therefore I'm currently unsure about changing this. Link: https://lore.kernel.org/all/20211006164628.s2mtsdd2jdbfyf7g@linutronix.de/ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Don't disable interrupts on PREEMPT_RT during atomic updatesMike Galbraith1-5/+10
Commit 8d7849db3eab7 ("drm/i915: Make sprite updates atomic") started disabling interrupts across atomic updates. This breaks on PREEMPT_RT because within this section the code attempt to acquire spinlock_t locks which are sleeping locks on PREEMPT_RT. According to the comment the interrupts are disabled to avoid random delays and not required for protection or synchronisation. If this needs to happen with disabled interrupts on PREEMPT_RT, and the whole section is restricted to register access then all sleeping locks need to be acquired before interrupts are disabled and some function maybe moved after enabling interrupts again. This includes: - prepare_to_wait() + finish_wait() due its wake queue. - drm_crtc_vblank_put() -> vblank_disable_fn() drm_device::vbl_lock. - skl_pfit_enable(), intel_update_plane(), vlv_atomic_update_fifo() and maybe others due to intel_uncore::lock - drm_crtc_arm_vblank_event() due to drm_device::event_lock and drm_device::vblank_time_lock. Don't disable interrupts on PREEMPT_RT during atomic updates. [bigeasy: drop local locks, commit message] Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Use preempt_disable/enable_rt() where recommendedMike Galbraith1-2/+4
Mario Kleiner suggest in commit ad3543ede630f ("drm/intel: Push get_scanout_position() timestamping into kms driver.") a spots where preemption should be disabled on PREEMPT_RT. The difference is that on PREEMPT_RT the intel_uncore::lock disables neither preemption nor interrupts and so region remains preemptible. The area covers only register reads and writes. The part that worries me is: - __intel_get_crtc_scanline() the worst case is 100us if no match is found. - intel_crtc_scanlines_since_frame_timestamp() not sure how long this may take in the worst case. It was in the RT queue for a while and nobody complained. Disable preemption on PREEPMPT_RT during timestamping. [bigeasy: patch description.] Cc: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Don't disable interrupts and pretend a lock as been acquired in ↵Sebastian Andrzej Siewior4-38/+7
__timeline_mark_lock(). This is a revert of commits d67739268cf0e ("drm/i915/gt: Mark up the nested engine-pm timeline lock as irqsafe") 6c69a45445af9 ("drm/i915/gt: Mark context->active_count as protected by timeline->mutex") The existing code leads to a different behaviour depending on whether lockdep is enabled or not. Any following lock that is acquired without disabling interrupts (but needs to) will not be noticed by lockdep. This it not just a lockdep annotation but is used but an actual mutex_t that is properly used as a lock but in case of __timeline_mark_lock() lockdep is only told that it is acquired but no lock has been acquired. It appears that its purpose is just satisfy the lockdep_assert_held() check in intel_context_mark_active(). The other problem with disabling interrupts is that on PREEMPT_RT interrupts are also disabled which leads to problems for instance later during memory allocation. Add a CONTEXT_IS_PARKED bit to intel_engine_cs and set_bit/clear_bit it instead of mutex_acquire/mutex_release. Use test_bit in the two identified spots which relied on the lockdep annotation. Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06random: Make it work on rtThomas Gleixner3-7/+10
Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq descriptor and feed it into the random generator as a source of entropy. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06scsi/fcoe: Make RT aware.Thomas Gleixner3-12/+12
Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06md: raid5: Make raid5_percpu handling RT awareThomas Gleixner2-2/+6
__raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic spews on RT. Serialize the access to the percpu data with a lock and keep the code preemptible. Reported-by: Udo van den Heuvel <udovdh@xs4all.nl> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Udo van den Heuvel <udovdh@xs4all.nl>
2023-11-06net: sched: Merge Qdisc::bstats and Qdisc::cpu_bstats data typesAhmed S. Darwish1-1/+1
The only factor differentiating per-CPU bstats data type (struct gnet_stats_basic_cpu) from the packed non-per-CPU one (struct gnet_stats_basic_packed) was a u64_stats sync point inside the former. The two data types are now equivalent: earlier commits added a u64_stats sync point to the latter. Combine both data types into "struct gnet_stats_basic_sync". This eliminates redundancy and simplifies the bstats read/write APIs. Use u64_stats_t for bstats "packets" and "bytes" data types. On 64-bit architectures, u64_stats sync points do not use sequence counter protection. Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-06efi: Allow efi=runtimeSebastian Andrzej Siewior1-0/+3
In case the command line option "efi=noruntime" is default at built-time, the user could overwrite its state by `efi=runtime' and allow it again. This is useful on PREEMPT_RT where "efi=noruntime" is default and the user might need to alter the boot order for instance. Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lkml.kernel.org/r/20210924134919.1913476-3-bigeasy@linutronix.de
2023-11-06efi: Disable runtime services on RTSebastian Andrzej Siewior1-1/+1
Based on measurements the EFI functions get_variable / get_next_variable take up to 2us which looks okay. The functions get_time, set_time take around 10ms. These 10ms are too much. Even one ms would be too much. Ard mentioned that SetVariable might even trigger larger latencies if the firmware will erase flash blocks on NOR. The time-functions are used by efi-rtc and can be triggered during run-time (either via explicit read/write or ntp sync). The variable write could be used by pstore. These functions can be disabled without much of a loss. The poweroff / reboot hooks may be provided by PSCI. Disable EFI's runtime wrappers on PREEMPT_RT. This was observed on "EFI v2.60 by SoftIron Overdrive 1000". Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lkml.kernel.org/r/20210924134919.1913476-2-bigeasy@linutronix.de
2023-11-06printk: remove deferred printingJohn Ogness1-3/+2
Since printing occurs either atomically or from the printing kthread, there is no need for any deferring or tracking possible recursion paths. Remove all printk defer functions and context tracking. Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06serial: 8250: implement write_atomicJohn Ogness6-44/+157
Implement a non-sleeping NMI-safe write_atomic() console function in order to support emergency console printing. Since interrupts need to be disabled during transmit, all usage of the IER register is wrapped with access functions that use the console_atomic_lock() function to synchronize register access while tracking the state of the interrupts. This is necessary because write_atomic() can be called from an NMI context that has preempted write_atomic(). Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-04Merge tag 'JH7110_515_SDK_v5.9.0' into vf2-515-develAndy Hu5-50/+830
2023-11-01Add ISP control for video2 and video3.zejian.su1-0/+46
Signed-off-by: zejian.su <zejian.su@starfivetech.com>
2023-11-01Expand 2 bytes after the SC buffer for the AE/AWB flag and copy the ↵zejian.su4-26/+54
histogram data to the SC buffer.
2023-11-01Add 16 ISP controls, remove the frame SYNC event to video7 (SC) These ↵zejian.su3-5/+661
controls are: WB, CAR, CCM, CFA, CTC, DBC, DNYUV, GMARGB, LCCF, OBC, OECF, R2Y, SAT, SHRP, YCRV, SC
2023-11-01media: starfive: isp: Fix enum isp subdev code bugChanghuang Liang1-13/+3
Fix enum isp subdev code bug. Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
2023-11-01media: starfive: isp: Update format pad table one by oneChanghuang Liang1-32/+14
Update format pad table one by one, it can simply code. Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
2023-11-01media: starfive: Add isp sc buffer pointChanghuang Liang2-1/+4
Add isp sc buffer point. Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
2023-11-01media: satrfive: stf_isp: Add new conctrl supportChanghuang Liang1-1/+52
Add new conctrl for jh7110 isp. Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
2023-11-01media: starfive: Add isp frame sync eventChanghuang Liang1-1/+25
Add isp frame sync event. Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
2023-11-01media: starfive: Add V4L2_CAP_IO_MC capabilitiesChanghuang Liang1-1/+1
Add V4L2_CAP_IO_MC capabilities. Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
2023-10-26Merge branch 'CR_7252_vf2_wifi_dongle_5.15_ziv.xu' into 'vf2-515-devel'VF2_v3.8.2andy.hu1-3/+0
CR_7252_vf2_wifi_dongle_5.15_ziv.xu See merge request sbc/linux!174
2023-10-26Merge tag 'JH7110_515_SDK_v5.8.2' into vf2-515-develAndy Hu1-38/+5
2023-10-25drivers: wireless: aic8800 : wifi dongle revert to one interfaceziv.xu1-3/+0
wifi dongle revert to one interface Signed-off-by: ziv.xu <ziv.xu@starfive.com>
2023-10-24Revert to original code to avoid possible mosaic problem.Windsome Zeng1-38/+5
Signed-off-by: Windsome Zeng <windsome.zeng@starfivetech.com>
2023-10-12Merge tag 'JH7110_515_SDK_v5.8.0' into vf2-515-develAndy Hu1-1/+0
2023-09-25reset: starfive: jh7110: Drop the unused EXPORT_SYMBOL_GPLHal Feng1-1/+0
reset_starfive_jh7110_generic_probe() is never called by other modules, so drop the EXPORT_SYMBOL_GPL for it. Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
2023-09-22Merge tag 'JH7110_515_SDK_v5.7.5' into vf2-515-develVF2_v3.7.5Andy Hu1-0/+1
2023-09-22Enlarge flush cache size to avoid flick on console/modetest and UVC 1080P ↵Windsome Zeng1-0/+1
camera. Signed-off-by: Windsome Zeng <windsome.zeng@starfivetech.com>
2023-09-21Merge tag 'JH7110_515_SDK_v5.7.4' into vf2-515-develAndy Hu4-8/+61
2023-09-21Merge branch 'CR_6347_linux_hdmi_hotplug_keith.zhao' into 'jh7110-5.15.y-devel'andy.hu1-1/+10
CR_6347 display : hdmi: fix hotplug hang See merge request sdk/linux!960
2023-09-21Merge branch 'CR_7149_UART_5.15_william.qiu' into 'jh7110-5.15.y-devel'andy.hu1-0/+4
CR_7149_5.15: uart: 8250: add reset operation in runtime PM See merge request sdk/linux!964
2023-09-21Mosaic cursor: Revert commit 30289b2ca780bcaf7acb1ffe88125a65b7e34577 as it ↵Windsome Zeng2-7/+47
will drop 50% performance. Just do real flush data while cursor is about to change. Other plane: According to the behavior of L2 cache controller in U74, only the last 2MB data is needed to be flushed. For 4K resolution, it will reduce flush loops from 518400 to 32768 on each frame update. Signed-off-by: Windsome Zeng <windsome.zeng@starfivetech.com>
2023-09-20uart: 8250: add reset operation in runtime PMWilliam Qiu1-0/+4
add reset operation in runtime PM Signed-off-by: William Qiu <william.qiu@starfivetech.com>
2023-09-20display : hdmi: fix hotplug hangkeith.zhao1-1/+10
Fixed the probability of hdmi crash after repeated insertion and removal Signed-off-by: keith.zhao <keith.zhao@starfivetech.com>
2023-09-14Merge branch 'CR_7358_VF2_5.15_radxa_gsensor_shengyang.chen' into ↵andy.hu5-50/+275
'vf2-515-devel' CR_7358_VF2_5.15: riscv: drm: panel: update radxa panel startup process and support accelerator-sc7a20 && riscv: iio: accel: add sc7a20 support for linux 515 See merge request sbc/linux!171
2023-09-14Merge tag 'JH7110_515_SDK_v5.7.3' into vf2-515-develAndy Hu1-4/+8