diff options
author | Jayachandran C <jchandra@broadcom.com> | 2013-06-10 02:41:10 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-06-13 11:46:43 -0400 |
commit | 8ecd08378c132536c7d47af225e09bd6f3a16779 (patch) | |
tree | 3ae51e9c8896f3d00fcdb51939d0157fa032ffa8 /arch/mips/netlogic | |
parent | 6099115e7e5e2c49d3822e093ca7df7015ca57a9 (diff) |
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: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5432/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/netlogic')
-rw-r--r-- | arch/mips/netlogic/common/irq.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/mips/netlogic/common/irq.c b/arch/mips/netlogic/common/irq.c index 9f84c60bf535..73facb2b33bb 100644 --- a/arch/mips/netlogic/common/irq.c +++ b/arch/mips/netlogic/common/irq.c | |||
@@ -253,13 +253,12 @@ asmlinkage void plat_irq_dispatch(void) | |||
253 | 253 | ||
254 | node = nlm_nodeid(); | 254 | node = nlm_nodeid(); |
255 | eirr = read_c0_eirr_and_eimr(); | 255 | eirr = read_c0_eirr_and_eimr(); |
256 | 256 | if (eirr == 0) | |
257 | i = __ilog2_u64(eirr); | ||
258 | if (i == -1) | ||
259 | return; | 257 | return; |
260 | 258 | ||
259 | i = __ffs64(eirr); | ||
261 | /* per-CPU IRQs don't need translation */ | 260 | /* per-CPU IRQs don't need translation */ |
262 | if (eirr & PERCPU_IRQ_MASK) { | 261 | if (i < PIC_IRQ_BASE) { |
263 | do_IRQ(i); | 262 | do_IRQ(i); |
264 | return; | 263 | return; |
265 | } | 264 | } |