Re: [PATCH 1/2] iio: imu: adis: add IRQF_NO_THREAD to non-FIFO trigger IRQ
From: Jonathan Cameron
Date: Wed Jun 03 2026 - 09:56:09 EST
On Wed, 3 Jun 2026 04:05:48 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Tue, Jun 02, 2026 at 05:17:26PM +0800, Runyu Xiao wrote:
> > devm_adis_probe_trigger() registers iio_trigger_generic_data_rdy_poll()
> > through devm_request_irq() on the non-FIFO path, but it does not add
> > IRQF_NO_THREAD to the IRQ flags.
> >
> > When the kernel is booted with forced IRQ threading, the parent IRQ can
> > otherwise be threaded by the IRQ core and the subsequent IIO trigger
> > child IRQ is then dispatched from irq/... thread context instead of
> > hardirq context. Because iio_trigger_generic_data_rdy_poll()
> > immediately drives iio_trigger_poll(), this violates the hardirq-only
> > IIO trigger helper contract and can push downstream trigger consumers
> > through the wrong execution context.
> >
> > Add IRQF_NO_THREAD on top of the existing adis->irq_flag value for the
> > non-FIFO request_irq() path, while preserving the current trigger
> > polarity and IRQF_NO_AUTOEN behavior.
>
> > Build-tested by compiling adis_trigger.o.
> >
> > No ADIS hardware was available for end-to-end runtime testing on this
> > submission branch.
>
> These two paragraphs are unneeded details and can go to the cover letter.
>
> ...
>
> Code wise IIRC another approach was discussed. But Jonathan may know better.
>
Whilst I dislike the necessity of marking these, I'm not aware of another
solution. Maybe the discussion Andy refers to what the one around
papering over ONESHOT where if that flag is set and there isn't a thread
handler it's a driver bug.
For this we might be able to on day do something cleverer but that would
first mean fixing up how we run top halfs when only the thread is called.
So with a patch descriptions tweaked as Andy suggests I'll pick these up.