Commit 38e0533c authored by Ben Dooks's avatar Ben Dooks Committed by Russell King

[ARM] 3871/1: S3C24XX: Fix ordering of EINT4..23

The demux code for the IRQ EINTs above 3 was
using find last set instead of finding first
set.

Also fix it so that we only check EINT4..7
when the parent EINT4t7 goes off, and the
8..23 when EINT8t23 goes off.
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 1f51c10c
...@@ -569,7 +569,7 @@ s3c_irq_demux_uart2(unsigned int irq, ...@@ -569,7 +569,7 @@ s3c_irq_demux_uart2(unsigned int irq,
} }
static void static void
s3c_irq_demux_extint(unsigned int irq, s3c_irq_demux_extint8(unsigned int irq,
struct irqdesc *desc, struct irqdesc *desc,
struct pt_regs *regs) struct pt_regs *regs)
{ {
...@@ -577,10 +577,38 @@ s3c_irq_demux_extint(unsigned int irq, ...@@ -577,10 +577,38 @@ s3c_irq_demux_extint(unsigned int irq,
unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK); unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
eintpnd &= ~eintmsk; eintpnd &= ~eintmsk;
eintpnd &= ~0xff; /* ignore lower irqs */
if (eintpnd) { /* we may as well handle all the pending IRQs here */
irq = fls(eintpnd);
irq += (IRQ_EINT4 - (4 + 1)); while (eintpnd) {
irq = __ffs(eintpnd);
eintpnd &= ~(1<<irq);
irq += (IRQ_EINT4 - 4);
desc_handle_irq(irq, irq_desc + irq, regs);
}
}
static void
s3c_irq_demux_extint4t7(unsigned int irq,
struct irqdesc *desc,
struct pt_regs *regs)
{
unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
eintpnd &= ~eintmsk;
eintpnd &= 0xff; /* only lower irqs */
/* we may as well handle all the pending IRQs here */
while (eintpnd) {
irq = __ffs(eintpnd);
eintpnd &= ~(1<<irq);
irq += (IRQ_EINT4 - 4);
desc_handle_irq(irq, irq_desc + irq, regs); desc_handle_irq(irq, irq_desc + irq, regs);
} }
...@@ -727,8 +755,8 @@ void __init s3c24xx_init_irq(void) ...@@ -727,8 +755,8 @@ void __init s3c24xx_init_irq(void)
/* setup the cascade irq handlers */ /* setup the cascade irq handlers */
set_irq_chained_handler(IRQ_EINT4t7, s3c_irq_demux_extint); set_irq_chained_handler(IRQ_EINT4t7, s3c_irq_demux_extint4t7);
set_irq_chained_handler(IRQ_EINT8t23, s3c_irq_demux_extint); set_irq_chained_handler(IRQ_EINT8t23, s3c_irq_demux_extint8);
set_irq_chained_handler(IRQ_UART0, s3c_irq_demux_uart0); set_irq_chained_handler(IRQ_UART0, s3c_irq_demux_uart0);
set_irq_chained_handler(IRQ_UART1, s3c_irq_demux_uart1); set_irq_chained_handler(IRQ_UART1, s3c_irq_demux_uart1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment