From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-rt-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: Michael Schanne <mschanne@kns.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>,
Chris Packham <chris.packham@alliedtelesis.co.nz>,
Todd Leitzel <tleitzel@kns.com>
Subject: [PATCH v4] Revert "uio: use threaded interrupts"
Date: Wed, 25 Nov 2026 17:35:54 +0100 [thread overview]
Message-ID: <20261125163554.aO63UBKf@linutronix.de> (raw)
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
reply other threads:[~2026-11-25 16:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261125163554.aO63UBKf@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=mschanne@kns.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tleitzel@kns.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®