• Florian Fainelli's avatar
    irqchip/bcm7120-l2: Fix interrupt status for multiple parent IRQs · 0aef3997
    Florian Fainelli authored
    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: a5042de2 ("irqchip: bcm7120-l2: Add Broadcom BCM7120-style Level 2 interrupt controller")
    Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Cc: linux-mips@linux-mips.org
    Cc: cernekee@gmail.com
    Cc: jason@lakedaemon.net
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: gregory.0xf0@gmail.com
    Cc: computersforpeace@gmail.com
    Link: http://lkml.kernel.org/r/1437691941-3100-1-git-send-email-f.fainelli@gmail.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    0aef3997
irq-bcm7120-l2.c 9.23 KB