Skip to contentSkip to conversation

ppc32: Fix problem with spurrious edge interrupts on old powermacs

PATCH New Benjamin Herrenschmidt 1 participant 1 message Aug 3, 2004 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc32: Fix problem with spurrious edge interrupts on old powermacs

Hi !

On old powermacs, it's possible that we get a stale edge interrupt when doing request_irq(), that typically happens with the DBDMA controller interrupts when the device was used by the firmware for booting.

I just tracked down a nasty memory corruption problem where that was causing the bmac driver to try to process packets before the driver internal data structures were properly initialized.

While I agree that the driver should (and will) be made more robust to such things, Paulus and I decided that it makes little sense to keep track of an "old" edge interrupt that happens before a driver does request_irq. (On those powermacs, those are only the DBDMA interrupts anyway, and none of the DBDMA users will care).

This patch implements a "startup" handler for the old Apple PIC that will "ack" pending edge interrupts before unmasking, thus preventing those stale interrupts to be delivered.

It also "fixes" the ppc32 irq core to call the startup() callback when available instead of just calling enable().

Please apply,
Ben.

arch/ppc/kernel/irq.c +6 -1
diff -urN linux-2.5/arch/ppc/kernel/irq.c linux-swsusp/arch/ppc/kernel/irq.c
@@ -171,7 +171,12 @@
 	if (!shared) {
 		desc->depth = 0;
 		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING);
-		unmask_irq(irq);
+		if (desc->handler) {
+			if (desc->handler->startup)
+				desc->handler->startup(irq);
+			else if (desc->handler->enable)
+				desc->handler->enable(irq);
+		}
 	}
 	spin_unlock_irqrestore(&desc->lock,flags);
 
arch/ppc/platforms/pmac_pic.c +28 -16

59 lines not on this page · raw message