icvs: don't request a non-threaded IRQ with IRQF_ONESHOT - #41
Conversation
cvs_init() registers cvs_irq_handler() as a primary (hardirq) handler via devm_request_irq(), but passes IRQF_ONESHOT. IRQF_ONESHOT is intended for threaded interrupts, where it keeps the interrupt line masked after the hardirq until the threaded handler has run. cvs_irq_handler() has no threaded component -- it only sets hostwake_event_arg and wakes a waitqueue -- so IRQF_ONESHOT is inappropriate here. On the Synaptics SVP7500 (06cb:0701) CVS bridge this leaves the device interrupt masked after an event; the bridge then stops delivering interrupts after a brief idle and wedges, after which libcamera can no longer drive the sensor and falls back to the "simple" pipeline with no frames flowing. Dropping IRQF_ONESHOT restores reliable interrupt delivery and streaming. Keep IRQF_NO_SUSPEND so the interrupt remains armed across system suspend. Fixes: 6a93817 ("gpio resources") Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
|
Please merge this 🙏 |
|
Confirming this on a different platform and CVS bridge, which I think strengthens the case that it's not bridge-specific.
Without this change, every cold boot logs the With One data point in the other direction: on this Lattice bridge I did not observe the post-idle wedge you saw on the SVP7500 — the camera worked even with the buggy flag (once the sensor-ownership race was worked around separately). So on this bridge the flag looks harmless at runtime but still trips the WARN and taints the kernel on every boot. Either way the flag is wrong for a non-threaded handler, and this is the correct minimal fix. +1 for merging. |
cvs_init()registerscvs_irq_handler()as a primary (hardirq) handler viadevm_request_irq()but passesIRQF_ONESHOT.IRQF_ONESHOTis intended for threaded interrupts — it keeps the line masked after the hardirq until the threaded handler runs.cvs_irq_handler()has no threaded component (it only setshostwake_event_argand wakes a waitqueue), so the flag is inappropriate. On the Synaptics SVP7500 (06cb:0701) CVS bridge it leaves the device interrupt masked after an event, so the bridge stops delivering interrupts after a brief idle and wedges. libcamera then can no longer drive the sensor and falls back to thesimplepipeline with no frames — theov08x40 … Unable to get rectangle N … Inappropriate ioctl for device+ simple-pipeline-fallback signature reported in #33, #31 and #36.Dropping
IRQF_ONESHOTrestores reliable IRQ delivery and streaming;IRQF_NO_SUSPENDis kept so the line stays armed across suspend.Tested on a Dell XPS 16 (Panther Lake, SVP7500 + ov08x40): with the change the RGB camera streams (500 frames @ 28.57 fps via libcamera
cam); without it the bridge wedges after a brief idle.