genirq: Unmask oneshot irqs when thread was not woken
authorThomas Gleixner <tglx@linutronix.de>
Tue, 7 Feb 2012 16:58:03 +0000 (17:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Mar 2012 00:34:29 +0000 (16:34 -0800)
commitb7f0787da3657100fe8fc8b3f0565b0bee341510
tree988e1b8e9e55ff3a8a38285ba7f413a688fc4470
parent6778e220c09cdfb19a326192fd25ee146755b95d
genirq: Unmask oneshot irqs when thread was not woken

commit ac5637611150281f398bb7a47e3fcb69a09e7803 upstream.

When the primary handler of an interrupt which is marked IRQ_ONESHOT
returns IRQ_HANDLED or IRQ_NONE, then the interrupt thread is not
woken and the unmask logic of the interrupt line is never
invoked. This keeps the interrupt masked forever.

This was not noticed as most IRQ_ONESHOT users wake the thread
unconditionally (usually because they cannot access the underlying
device from hard interrupt context). Though this behaviour was nowhere
documented and not necessarily intentional. Some drivers can avoid the
thread wakeup in certain cases and run into the situation where the
interrupt line s kept masked.

Handle it gracefully.

Reported-and-tested-by: Lothar Wassmann <lw@karo-electronics.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/irq/chip.c