mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4] Revert "uio: use threaded interrupts"
@ 2026-11-25 16:35 Sebastian Andrzej Siewior
  0 siblings, 0 replies; only message in thread
From: Sebastian Andrzej Siewior @ 2026-11-25 16:35 UTC (permalink / raw)
  To: linux-rt-devel, linux-kernel
  Cc: Michael Schanne, Greg Kroah-Hartman, Thomas Gleixner,
	Steven Rostedt, Chris Packham, Todd Leitzel

From: Michael Schanne <mschanne@kns.com>

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@kns.com>
Acked-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
v4: https://lore.kernel.org/TY0PR01MB5723E978A7EE94644B15621FD2782@TY0PR01MB5723.apcprd01.prod.exchangelabs.com
  - Reposted Michael's patch with small fixes:
    - Use Tabs and not Spaces. I think this broke applying it.
    - Remove the comment for uio_interrupt_thread() and rename
      uio_interrupt_handler() -> uio_interrupt()

v3: https://lore.kernel.org/TY0PR01MB57238A4ACC7B9B3214A00A6CD2772@TY0PR01MB5723.apcprd01.prod.exchangelabs.com
  - Revise commit message

v2: Instead of an ifdef, revert the cited commit
v1: https://lore.kernel.org/all/TY0PR0101MB48676D503A7F6C5CAC112B3BD2A52@TY0PR0101MB4867.apcprd01.prod.exchangelabs.com/

Initial patch/ thread: https://lore.kernel.org/TY0PR0101MB48672132B8525B7B39565EE4D2A52@TY0PR0101MB4867.apcprd01.prod.exchangelabs.com

 drivers/uio/uio.c | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index f8fa205226601..14880fa9623c4 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -438,36 +438,22 @@ void uio_event_notify(struct uio_info *info)
 EXPORT_SYMBOL_GPL(uio_event_notify);
 
 /**
- * uio_interrupt_handler - hardware interrupt handler
+ * uio_interrupt - hardware interrupt handler
  * @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;
+		uio_event_notify(idev->info);
 
 	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);
-
-	return IRQ_HANDLED;
-}
-
 struct uio_listener {
 	struct uio_device *dev;
 	s32 event_count;
@@ -1044,8 +1030,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.55.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-25 16:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 16:35 [PATCH v4] Revert "uio: use threaded interrupts" Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®