drivers/iio/buffer/industrialio-triggered-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
iio_triggered_buffer_setup_ext() unconditionally passes IRQF_ONESHOT to
iio_alloc_pollfunc(), even when the caller provides no thread function.
This causes a warning in __setup_irq() when the trigger is later
attached:
WARNING: kernel/irq/manage.c:1502 at __setup_irq+0x4ee/0x700
IRQF_ONESHOT keeps the IRQ masked until the threaded handler completes,
but with no threaded handler this is semantically wrong. Only set the
flag when a thread function is actually provided.
Assisted-by: GitHub Copilot CLI:claude-opus-4-6
Signed-off-by: Дамјан Георгиевски <gdamjan@gmail.com>
---
This patch is a safety fix for how the Industrial I/O (IIO) subsystem handles
interrupts when setting up a triggered buffer.
It changes the flags passed to iio_alloc_pollfunc to ensure that the IRQF_ONESHOT
flag is only applied when a threaded interrupt handler actually exists.
Full disclosure, I got the warning on my laptop, and got Claude to debug
it. The explanation it gave sounds reasonable to me, but I'm not
personally familiar with the actual code.
---
drivers/iio/buffer/industrialio-triggered-buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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,
---
base-commit: 1d5dcaa3bd65f2e8c9baa14a393d3a2dc5db7524
change-id: 20260513-patch-iio-buffer-395d8ca94768
Best regards,
--
Дамјан Георгиевски <gdamjan@gmail.com>
On Fri, May 15, 2026 at 12:46:00AM +0200, Дамјан Гео ргиевски wrote: > iio_triggered_buffer_setup_ext() unconditionally passes IRQF_ONESHOT to > iio_alloc_pollfunc(), even when the caller provides no thread function. > This causes a warning in __setup_irq() when the trigger is later > attached: > > WARNING: kernel/irq/manage.c:1502 at __setup_irq+0x4ee/0x700 > > IRQF_ONESHOT keeps the IRQ masked until the threaded handler completes, > but with no threaded handler this is semantically wrong. Only set the > flag when a thread function is actually provided. Yes, please read the mailing list archive and find the previous attempt to fix this and the associated discussions. -- With Best Regards, Andy Shevchenko
On Fri, 15 May 2026 13:46:30 +0300 Andy Shevchenko <andriy.shevchenko@intel.com> wrote: > On Fri, May 15, 2026 at 12:46:00AM +0200, Дамјан Гео ргиевски wrote: > > iio_triggered_buffer_setup_ext() unconditionally passes IRQF_ONESHOT to > > iio_alloc_pollfunc(), even when the caller provides no thread function. > > This causes a warning in __setup_irq() when the trigger is later > > attached: > > > > WARNING: kernel/irq/manage.c:1502 at __setup_irq+0x4ee/0x700 > > > > IRQF_ONESHOT keeps the IRQ masked until the threaded handler completes, > > but with no threaded handler this is semantically wrong. Only set the > > flag when a thread function is actually provided. > > Yes, please read the mailing list archive and find the previous attempt to fix > this and the associated discussions. > Just to check - what is the driver in use? The fixes so far all belong in the drivers, not papering over it in the core (note this is maybe the 3rd time this same patch has been posted and rejected!) Jonathan
© 2016 - 2026 Red Hat, Inc.