ppc_irq_dispatch_handler and unhandled interrupts

Hollis Blanchard hollis at austin.ibm.com
Fri Nov 22 03:58:55 EST 2002

Here's the failure mode:
On a 405LP (using ppc405_pic), an irq is becoming unmasked[1] (in
UIC0_ER). ppc_irq_dispatch_handler sees irq_desc[0].action == NULL, and
correctly complains of an unhandled interrupt and masks it off. However
at the end of the same function (label "out"), the irq is unmasked again
because irq_desc[0].handler == ppc405_pic (irq_desc[0..NR_IRQS] =
ppc405_pic; see ppc4xx_init_IRQ() ). So the irq is unmasked, occurs
again, is masked, is unmasked, occurs again...

The attached patch fixes the problem by checking desc->action as well as
desc->handler - there is no sense unmasking an interrupt if we already
know there are no drivers ready to handle it.

[1] In my particular case, UIC0_ER is being modified by BIOS when waking
from sleep (the BIOS later returns control to Linux), which could be
worked around in wakeup code. However in the interest of handling as
many unexpected hardware and software errors as possible, I believe this
patch should be applied.

PowerPC Linux
IBM Linux Technology Center
-------------- next part --------------
--- arch/ppc/kernel/irq.c	2001/12/18 00:18:00
+++ arch/ppc/kernel/irq.c	2002/11/21 16:13:22
@@ -513,7 +513,7 @@
 	 * The ->end() handler has to deal with interrupts which got
 	 * disabled while the handler was running.
-	if (irq_desc[irq].handler) {
+	if (desc->handler && desc->action) {
 		if (irq_desc[irq].handler->end)
 		else if (irq_desc[irq].handler->enable)

More information about the Linuxppc-dev mailing list