genirq: Clear action->thread_mask if IRQ_ONESHOT is not set

Xommit ac5637611(genirq: Unmask oneshot irqs when thread was not woken)
fails to unmask when a !IRQ_ONESHOT threaded handler is handled by

This happens because thread_mask is or'ed unconditionally in
irq_wake_thread(), but for !IRQ_ONESHOT interrupts never cleared.  So
the check for !desc->thread_active fails and keeps the interrupt

Keep the thread_mask zero for !IRQ_ONESHOT interrupts.

Document the thread_mask magic while at it.

Reported-and-tested-by: Sven Joachim <>
Reported-and-tested-by: Stefan Lippers-Hollmann <>
Signed-off-by: Thomas Gleixner <>
Signed-off-by: Linus Torvalds <>
1 file changed