Commit 8ecd0837 authored by Jayachandran C's avatar Jayachandran C Committed by Ralf Baechle

MIPS: Netlogic: Fix plat_irq_dispatch

Fix an issue in plat_irq_dispatch due to which it can call do_IRQ
with a PIC irq that is not mapped.

When a per-cpu interrupt and a PIC interrupt are both active, the
check 'eirr & PERCPU_IRQ_MASK' will be true, but the interrupt in 'i'
will be the number of the PIC interrupt. In this case, we will call
do_IRQ on the PIC interrupt without mapping it with nlm_irq_to_xirq().

Fix this by using __ffs64 instead of __ilog2_u64 and using the
interrupt number instead of mask to identify per-cpu interrupts.
Signed-off-by: default avatarJayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5432/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 6099115e
...@@ -253,13 +253,12 @@ asmlinkage void plat_irq_dispatch(void) ...@@ -253,13 +253,12 @@ asmlinkage void plat_irq_dispatch(void)
node = nlm_nodeid(); node = nlm_nodeid();
eirr = read_c0_eirr_and_eimr(); eirr = read_c0_eirr_and_eimr();
if (eirr == 0)
i = __ilog2_u64(eirr);
if (i == -1)
return; return;
i = __ffs64(eirr);
/* per-CPU IRQs don't need translation */ /* per-CPU IRQs don't need translation */
if (eirr & PERCPU_IRQ_MASK) { if (i < PIC_IRQ_BASE) {
do_IRQ(i); do_IRQ(i);
return; return;
} }
......
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