From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 02 Nov 2014 02:06:33 +0100 (CET) Received: from mail-pa0-f41.google.com ([209.85.220.41]:60300 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27012449AbaKBBFCjXK4R (ORCPT ); Sun, 2 Nov 2014 02:05:02 +0100 Received: by mail-pa0-f41.google.com with SMTP id rd3so10026755pab.28 for ; Sat, 01 Nov 2014 18:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=riGQ5T67v7cabDXnSkNXaziN0y4nGlD36niEIPnT2eQ=; b=lfGzM4ys71NDDaVtu+Lx3ul4I9TBjO7eKa3BUUMrrAycAPOXlysd3JmTsEdT2M98FW oubg6Sn+YWiJ9o1SkIgGm2SqG/wKvXKfXlJC0uEg9hf31kFvMcuheBGmv7QL/psuhaXy HdDj4ntIxAfzfWdZh/KEL3DkTpd3GvnH5YiPBKyI2nWqTaHxlkv0ANi8nVbGZ8igC/FQ aIViTsmmarO+lbCQwLmJM46U5skSYPjcsuTiB/JGK6wxOAphdyqF84MBZXDpUU+AhiLm bn9C5qOUaHJ4DwFuLDCqnPpO6akbrwhqLPhYRYS82xCCL5U/sLGkQwxZK3oG5/X8KxCt nSBg== X-Received: by 10.66.188.167 with SMTP id gb7mr3905864pac.23.1414890295342; Sat, 01 Nov 2014 18:04:55 -0700 (PDT) Received: from localhost (b32.net. [192.81.132.72]) by mx.google.com with ESMTPSA id f7sm13488343pdj.15.2014.11.01.18.04.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Nov 2014 18:04:54 -0700 (PDT) From: Kevin Cernekee To: arnd@arndb.de, f.fainelli@gmail.com, tglx@linutronix.de, jason@lakedaemon.net, ralf@linux-mips.org Cc: linux-sh@vger.kernel.org, sergei.shtylyov@cogentembedded.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, mbizon@freebox.fr, jogo@openwrt.org, linux-mips@linux-mips.org Subject: [PATCH V3 06/14] irqchip: bcm7120-l2: Eliminate bad IRQ check Date: Sat, 1 Nov 2014 18:03:53 -0700 Message-Id: <1414890241-9938-7-git-send-email-cernekee@gmail.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1414890241-9938-1-git-send-email-cernekee@gmail.com> References: <1414890241-9938-1-git-send-email-cernekee@gmail.com> Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 43828 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: cernekee@gmail.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips This check may be prone to race conditions, e.g. 1) Some external event (e.g. GPIO level) causes an IRQ to become pending 2) Peripheral asserts the L2 IRQ 3) CPU takes an interrupt 4) The event from #1 goes away 5) bcm7120_l2_intc_irq_handle() reads back a 0 status Unlike the hardware supported by brcmstb-l2, the bcm7120-l2 controller does not latch the IRQ status. Bits can change if the inputs to the controller change. Also, do_bad_IRQ() is an ARM-specific macro. So let's just nuke it. Signed-off-by: Kevin Cernekee Acked-by: Florian Fainelli --- drivers/irqchip/irq-bcm7120-l2.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c index b9f4fb8..7086fe0 100644 --- a/drivers/irqchip/irq-bcm7120-l2.c +++ b/drivers/irqchip/irq-bcm7120-l2.c @@ -27,8 +27,6 @@ #include "irqchip.h" -#include - /* Register offset in the L2 interrupt controller */ #define IRQEN 0x00 #define IRQSTAT 0x04 @@ -51,19 +49,12 @@ static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc) chained_irq_enter(chip, desc); status = __raw_readl(b->base + IRQSTAT); - - if (status == 0) { - do_bad_IRQ(irq, desc); - goto out; - } - - do { + while (status) { irq = ffs(status) - 1; status &= ~(1 << irq); generic_handle_irq(irq_find_mapping(b->domain, irq)); - } while (status); + } -out: chained_irq_exit(chip, desc); } -- 2.1.1