From: "tip-bot2 for Sebastian Andrzej Siewior" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Thomas Gleixner <tglx@kernel.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org
Subject: [tip: irq/core] genirq: Warn about using IRQF_ONESHOT without a threaded handler
Date: Tue, 13 Jan 2026 08:58:56 -0000 [thread overview]
Message-ID: <176829473742.510.5940174319056100768.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260112134013.eQWyReHR@linutronix.de>
The following commit has been merged into the irq/core branch of tip:
Commit-ID: aef30c8d569c0f31715447525640044c74feb26f
Gitweb: https://git.kernel.org/tip/aef30c8d569c0f31715447525640044c74feb26f
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Mon, 12 Jan 2026 14:40:13 +01:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 13 Jan 2026 09:56:25 +01:00
genirq: Warn about using IRQF_ONESHOT without a threaded handler
IRQF_ONESHOT disables the interrupt source until after the threaded
handler completed its work. This is needed to allow the threaded handler
to run - otherwise the CPU will get back to the interrupt handler
because the interrupt source remains active and the threaded handler
will not able to do its work.
Specifying IRQF_ONESHOT without a threaded handler does not make sense.
It could be a leftover if the handler _was_ threaded and changed back to
primary and the flag was not removed. This can be problematic in the
`threadirqs' case because the handler is exempt from forced-threading.
This in turn can become a problem on a PREEMPT_RT system if the handler
attempts to acquire sleeping locks.
Warn about missing threaded handlers with the IRQF_ONESHOT flag.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/20260112134013.eQWyReHR@linutronix.de
---
kernel/irq/manage.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index bc2d36b..dde1aa6 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1474,6 +1474,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
new->flags |= irqd_get_trigger_type(&desc->irq_data);
/*
+ * IRQF_ONESHOT means the interrupt source in the IRQ chip will be
+ * masked until the threaded handled is done. If there is no thread
+ * handler then it makes no sense to have IRQF_ONESHOT.
+ */
+ WARN_ON_ONCE(new->flags & IRQF_ONESHOT && !new->thread_fn);
+
+ /*
* Check whether the interrupt nests into another interrupt
* thread.
*/
next prev parent reply other threads:[~2026-01-13 8:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 13:40 [PATCH] " Sebastian Andrzej Siewior
2026-01-12 17:46 ` Laurent Pinchart
2026-01-14 10:29 ` Stefan Klug
2026-01-13 8:58 ` tip-bot2 for Sebastian Andrzej Siewior [this message]
2026-01-13 12:05 ` [tip: irq/core] " Sebastian Andrzej Siewior
2026-01-13 15:26 ` Thomas Gleixner
2026-02-02 23:27 ` Bert Karwatzki
2026-02-03 8:38 ` Sebastian Andrzej Siewior
2026-02-03 10:43 ` Bert Karwatzki
2026-02-03 14:58 ` Sebastian Andrzej Siewior
2026-02-07 15:46 ` Jonathan Cameron
2026-02-09 2:00 ` srinivas pandruvada
2026-02-14 15:00 ` Jonathan Cameron
2026-02-14 15:08 ` Jonathan Cameron
2026-02-03 17:29 ` srinivas pandruvada
2026-02-07 15:42 ` Jonathan Cameron
2026-03-01 23:17 ` David Lechner
2026-03-01 23:57 ` David Lechner
2026-03-01 22:45 ` David Lechner
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=176829473742.510.5940174319056100768.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=maz@kernel.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/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®