[PATCH v3] Revert "uio: use threaded interrupts"
From: Mike Schanne
Date: Fri Nov 20 2026 - 15:21:32 EST
This reverts commit f8a27dfa4b82d442af1c0645a5acc70cc97c67f6.
The patch claims to fix the issue with nested interrupts by using
request_threaded_irq(). Should an IRQ be nested, then __setup_irq() will
overwrite the primary handler, and the submitted uio_interrupt_handler()
will not be called (only the threaded handler).
On non-nested interrupts, both handlers are installed and work
properly. In forced threaded environments, such as PREEMPT_RT, it
results in two threads, adding additional overhead.
Therefore revert the change.
Fixes: f8a27dfa4b82d ("uio: use threaded interrupts")
Signed-off-by: Michael Schanne <mschanne@xxxxxxx>
---
v3: Revise commit message
v2: Instead of an ifdef, revert the cited commit
v1: https://lore.kernel.org/all/TY0PR0101MB48676D503A7F6C5CAC112B3BD2A52@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
---
drivers/uio/uio.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index f8fa20522660..9ef5b276b090 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -442,30 +442,21 @@ EXPORT_SYMBOL_GPL(uio_event_notify);
* @irq: IRQ number, can be UIO_IRQ_CYCLIC for cyclic timer
* @dev_id: Pointer to the devices uio_device structure
*/
-static irqreturn_t uio_interrupt_handler(int irq, void *dev_id)
+static irqreturn_t uio_interrupt(int irq, void *dev_id)
{
struct uio_device *idev = (struct uio_device *)dev_id;
irqreturn_t ret;
ret = idev->info->handler(irq, idev->info);
if (ret == IRQ_HANDLED)
- ret = IRQ_WAKE_THREAD;
-
- return ret;
-}
-
/**
* uio_interrupt_thread - irq thread handler
* @irq: IRQ number
* @dev_id: Pointer to the devices uio_device structure
*/
-static irqreturn_t uio_interrupt_thread(int irq, void *dev_id)
-{
- struct uio_device *idev = (struct uio_device *)dev_id;
+ uio_event_notify(idev->info);
- uio_event_notify(idev->info);
-
- return IRQ_HANDLED;
+ return ret;
}
struct uio_listener {
@@ -1044,8 +1035,8 @@ int __uio_register_device(struct module *owner,
* FDs at the time of unregister and therefore may not be
* freed until they are released.
*/
- ret = request_threaded_irq(info->irq, uio_interrupt_handler, uio_interrupt_thread,
- info->irq_flags, info->name, idev);
+ ret = request_irq(info->irq, uio_interrupt,
+ info->irq_flags, info->name, idev);
if (ret) {
info->uio_dev = NULL;
goto err_request_irq;
--
2.53.0
This email is non-binding, is subject to contract, and neither Kulicke and Soffa Industries, Inc. nor its subsidiaries (each and collectively “K&S”) shall have any obligation to you to consummate the transactions herein or to enter into any agreement, other than in accordance with the terms and conditions of a definitive agreement if and when negotiated, finalized and executed between the parties. This email and all its contents are protected by International and United States copyright laws. Any reproduction or use of all or any part of this email without the express written consent of K&S is prohibited.