Fix s3c_irq_demux_extint8 to handle masked but pending IRQs

Balaji Rao balajirrao at openmoko.org
Tue Dec 9 19:57:08 CET 2008


Hi,

It was observed that  even after the move to level irq on pcf50633, the
problem of 'the phone doesn't resume if POWER is pressed during
transition to standby' remains.

The original problem was due to a lost edge.

The present problem - When POWER is pressed during the transition,
handle_level_irq runs which looks at the IRQ_DISABLED flag set by
pcf50633_suspend and masks the irq on chip. Now when the cpu wakes up
(level keeps hitting us), s3c_irq_demux_extint8 runs, which tries to
handle all pending irqs. But before it does so, it applies the mask
and hence not all pending irqs were acked and hence, our pmu's irq
(level) caused an irq flood..

This patch clears those interrupts which are masked, but pending. Fixes
the problem for me. Mildly tested.


Signed-off-by: Balaji Rao <balajirrao at openmoko.org>

diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index d696bbd..e236ec7 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -497,6 +497,20 @@ s3c_irq_demux_extint8(unsigned int irq,
 		generic_handle_irq(irq);
 	}
 
+	/* ACK those interrupts which are masked, but pending */
+	eintpnd = __raw_readl(S3C24XX_EINTPEND);
+	eintmsk = __raw_readl(S3C24XX_EINTMASK);
+
+	eintpnd &= eintmsk;
+	eintpnd &= ~0xff;	/* ignore lower irqs */
+
+	while (eintpnd) {
+		irq = __ffs(eintpnd);
+		eintpnd &= ~(1 << irq);
+
+		irq += (IRQ_EINT4 - 4);
+		s3c_irqext_ack(irq);
+	}
 }
 
 static void




More information about the openmoko-kernel mailing list