Re: [PATCH 19/21] iio: Use IRQF_NO_THREAD

David Lechner
2026-01-23T20:56:35Z

On 1/23/26 5:37 AM, Sebastian Andrzej Siewior wrote:
> The interrupt handler iio_trigger_generic_data_rdy_poll() will invoke
> other interrupt handler and this supposed to happen from within the
> hardirq.
>
> Use IRQF_NO_THREAD to forbid forced-threading.
>

...

> diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
> index 4d570383ef025..9e4a66477d2d0 100644
> --- a/drivers/iio/adc/ad7766.c
> +++ b/drivers/iio/adc/ad7766.c
> @@ -184,12 +184,6 @@ static const struct iio_info ad7766_info = {
> .read_raw = &ad7766_read_raw,
> };
>
> -static irqreturn_t ad7766_irq(int irq, void *private)
> -{
> - iio_trigger_poll(private);
> - return IRQ_HANDLED;
> -}
> -

Replacing this with iio_trigger_generic_data_rdy_poll() seems like a
separate improvement that should be in a separate patch.

At a minimum, the commit message should explain this change. But I expect
the reason will make it obvious it should be a separate patch.

> static int ad7766_set_trigger_state(struct iio_trigger *trig, bool enable)
> {
> struct ad7766 *ad7766 = iio_trigger_get_drvdata(trig);
> @@ -260,8 +254,8 @@ static int ad7766_probe(struct spi_device *spi)
> * Some platforms might not allow the option to power it down so
> * don't enable the interrupt to avoid extra load on the system
> */
> - ret = devm_request_irq(&spi->dev, spi->irq, ad7766_irq,
> - IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
> + ret = devm_request_irq(&spi->dev, spi->irq, iio_trigger_generic_data_rdy_poll,
> + IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN | IRQF_NO_THREAD,
> dev_name(&spi->dev),
> ad7766->trig);
> if (ret < 0)