Skip to contentSkip to conversation

genirq/spurious: Recognize handled IRQs with threaded wakeups

PATCH Applied Avi Weiss 2 participants 2 messages Oct 26 – Nov 8 IRQ

lore
Share & tools
lore

Avi Weiss

author
#0 lore raw

PATCH 1/1 genirq/spurious: Recognize handled IRQs with threaded wakeups

try_one_irq() compares the result of handle_irq_event() with IRQ_HANDLED. For shared IRQs, one handler may return IRQ_HANDLED while another returns IRQ_WAKE_THREAD. The combined result fails the equality check, so misrouted IRQ recovery does not credit an interrupt that was handled.

Check the IRQ_HANDLED bit instead. Leave IRQ_WAKE_THREAD-only results unchanged.

Fixes 3a43e05f4d06 ("irq: Handle spurios irq detection for threaded irqs")

---
Tested with simulated shared IRQ handlers under QEMU using irqfixup=1 on Linux 7.3.0-rc5+.

The unhandled counts for IRQ_NONE, IRQ_HANDLED, IRQ_WAKE_THREAD, and the combined result were 1/0/1/1 before the fix and 1/0/1/0 afterward (as expected).

Both primary handlers and the IRQ thread executed in the mixed case before and after the patch.

 kernel/irq/spurious.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/spurious.c +1 -1
index 73280ccb74b08..48d3ef35e763f 100644
@@ -68,7 +68,7 @@ static bool try_one_irq(struct irq_desc *desc, bool force)
 	/* Mark it poll in progress */
 	desc->istate |= IRQS_POLL_INPROGRESS;
 	do {
-		if (handle_irq_event(desc) == IRQ_HANDLED)
+		if (handle_irq_event(desc) & IRQ_HANDLED)
 			ret = true;
 		/* Make sure that there is still a valid action */
 		action = desc->action;

base-commit: e74798f2f8e1562f2bbd2fed8d81929eeef39ffc

Signature · 1 line
2.43.0
merge bot Applied
#1 lore raw
The following commit has been merged into the irq/core branch of tip:

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     6c62ec6029c1480262b9691d8792ff0aa04adba5
Gitweb:        https://git.kernel.org/tip/6c62ec6029c1480262b9691d8792ff0aa04adba5
Author:        Avi Weiss <[email protected]>
AuthorDate:    Mon, 26 Oct 2026 09:40:04 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sun, 08 Nov 2026 17:39:43 +01:00

genirq/spurious: Recognize handled IRQs with threaded wakeups

try_one_irq() compares the result of handle_irq_event() with IRQ_HANDLED. For shared IRQs, one handler may return IRQ_HANDLED while another returns IRQ_WAKE_THREAD. The combined result fails the equality check, so misrouted IRQ recovery does not credit an interrupt that was handled.

Check the IRQ_HANDLED bit instead. Leave IRQ_WAKE_THREAD-only results unchanged.

Fixes 3a43e05f4d06 ("irq: Handle spurios irq detection for threaded irqs")
---
 kernel/irq/spurious.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/spurious.c +1 -1
index 73280cc..48d3ef3 100644
@@ -68,7 +68,7 @@ static bool try_one_irq(struct irq_desc *desc, bool force)
 	/* Mark it poll in progress */
 	desc->istate |= IRQS_POLL_INPROGRESS;
 	do {
-		if (handle_irq_event(desc) == IRQ_HANDLED)
+		if (handle_irq_event(desc) & IRQ_HANDLED)
 			ret = true;
 		/* Make sure that there is still a valid action */
 		action = desc->action;