irqchip/bcm7120-l2: Fix interrupt status for multiple parent IRQs
irqchip/bcm7120-l2: Fix interrupt status for multiple parent IRQs

Our irq-bcm7120-l2 interrupt controller driver utilizes the same handler
function for the different parent interrupts it services: UPG_MAIN, UPG_BSC for
instance.

The problem is that function reads the IRQSTAT register which can combine
interrupt causes for different parent interrupts, such that we can end-up in
the following situation:

- CPU takes an interrupt
- bcm7120_l2_intc_irq_handle() reads IRQSTAT
- generic_handle_irq() is invoked
- there are still pending interrupts flagged in IRQSTAT from a different parent
- handle_bad_irq() is invoked for these since they come from a different irq_desc/irq

In order to fix this, make sure that we always mask IRQSTAT with the
appropriate bits that correspond go the parent interrupt source this is coming
from. To simplify things, associate an unique structure per parent interrupt
handler to avoid multiplying the number of lookups.

Fixes: a5042de2688d ("irqchip: bcm7120-l2: Add Broadcom BCM7120-style Level 2 interrupt controller")
Signed-off-by: Florian Fainelli <59190c1867e3222b932a0de3c668eb2d980d69a2@gmail.com>
Cc: 562397917b9a8bf316569a848858b12fb417723f@linux-mips.org
Cc: 3105dbb3dd63fbb4f6371cfb04adc6726f76c56b@gmail.com
Cc: 68c46a606457643eab92053c1c05574abb26f861@lakedaemon.net
Cc: 6666c341d8c988aba87090ea539f3c04be03651c@broadcom.com
Cc: 5545c2196fdf3421ce913d3d9046eafb23ba0da5@gmail.com
Cc: ac73eed4b8a8c9127255a2696c52b2e7503720b8@gmail.com
Link: http://lkml.kernel.org/r/1437691941-3100-1-git-send-email-59190c1867e3222b932a0de3c668eb2d980d69a2@gmail.com
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

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