Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755072AbbG1Avn (ORCPT ); Mon, 27 Jul 2015 20:51:43 -0400 Received: from mail-yk0-f173.google.com ([209.85.160.173]:35990 "EHLO mail-yk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754703AbbG1Avm (ORCPT ); Mon, 27 Jul 2015 20:51:42 -0400 MIME-Version: 1.0 In-Reply-To: <1437691941-3100-1-git-send-email-f.fainelli@gmail.com> References: <1437691941-3100-1-git-send-email-f.fainelli@gmail.com> From: Gregory Fong Date: Mon, 27 Jul 2015 17:51:12 -0700 Message-ID: Subject: Re: [PATCH] irqchip: bcm7120-l2: Fix interrupt status for multiple parent IRQs To: Florian Fainelli Cc: "linux-kernel@vger.kernel.org" , linux-mips@linux-mips.org, Kevin Cernekee , jason@lakedaemon.net, tglx@linutronix.de, bcm-kernel-feedback-list , Brian Norris Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2391 Lines: 56 On Thu, Jul 23, 2015 at 3:52 PM, Florian Fainelli wrote: > 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 Acked-by: Gregory Fong > --- > drivers/irqchip/irq-bcm7120-l2.c | 51 ++++++++++++++++++++++++++++++---------- > 1 file changed, 39 insertions(+), 12 deletions(-) > > diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c > index 3ba5cc780fcb..8302d45d13ac 100644 > --- a/drivers/irqchip/irq-bcm7120-l2.c > +++ b/drivers/irqchip/irq-bcm7120-l2.c > @@ -47,14 +47,20 @@ struct bcm7120_l2_intc_data { > struct irq_domain *domain; > bool can_wake; > u32 irq_fwd_mask[MAX_WORDS]; > - u32 irq_map_mask[MAX_WORDS]; > + struct bcm7120_l1_intc_data *l1_data; > int num_parent_irqs; > const __be32 *map_mask_prop; > }; > > +struct bcm7120_l1_intc_data { > + struct bcm7120_l2_intc_data *b; > + u32 irq_map_mask[MAX_WORDS]; > +}; I'm not sure the name bcm7120_l1_intc_data is a good name for this, but I can't think of a better one, and it really doesn't matter that much. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/