MIPS: Netlogic: Fix plat_irq_dispatch
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 <1bc8cf2274d8680f3a9b88ac7b7d2a9e0d1d4ca2@broadcom.com>
Cc: 562397917b9a8bf316569a848858b12fb417723f@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5432/
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs