Re: [tip: irq/core] genirq: Warn about using IRQF_ONESHOT without a threaded handler

From: David Lechner

Date: Sun Mar 01 2026 - 17:45:53 EST


On 2/3/26 2:38 AM, Sebastian Andrzej Siewior wrote:
> On 2026-02-03 00:27:40 [+0100], Bert Karwatzki wrote:
>>
>> The warning appears because iio_triggered_buffer_setup_ext() (in
>> drivers/iio/buffer/industrialio-triggered-buffer.c) is called with thread = NULL
>> during the probe of the iio device and calls iio_alloc_pollfunc()
>> (in drivers/iio/industrialio-trigger.c) with thread = NULL and type = IRQF_ONESHOT.
>>
>> A simple fix could be this:
>>
>> diff --git a/drivers/iio/buffer/industrialio-triggered-buffer.c b/drivers/iio/buffer/industrialio-triggered-buffer.c
>> index 9bf75dee7ff8..40eea3a44724 100644
>> --- a/drivers/iio/buffer/industrialio-triggered-buffer.c
>> +++ b/drivers/iio/buffer/industrialio-triggered-buffer.c
>> @@ -64,7 +64,7 @@ int iio_triggered_buffer_setup_ext(struct iio_dev *indio_dev,
>>
>> indio_dev->pollfunc = iio_alloc_pollfunc(h,
>> thread,
>> - IRQF_ONESHOT,
>> + thread ? IRQF_ONESHOT : 0,
>> indio_dev,
>> "%s_consumer%d",
>> indio_dev->name,
>>
>>
>> Are there any problems with this?
>
> Urgh. Haven't seen those.
>
> Looking at all the users of of *iio_triggered_buffer_setup*() the
> primary handler is either NULL or iio_pollfunc_store_time().
> So IRQF_ONESHOST should work all the time.
>
> Then there is
> - drivers/iio/adc/vf610_adc.c
> - drivers/iio/common/hid-sensors/hid-sensor-trigger.c

I think we also have in the list:

- drivers/iio/adc/stm32-dfsdm-adc.c

>
> They use iio_pollfunc_store_time() as primary and have no secondary.
> This would trigger the warning but not having a secondary handler while
> returning IRQF_WAKE_THREAD should create a warning of its own.
> What did I miss?
>
>> Bert Karwatzki
>
> Sebastian
>