From patchwork Wed May 23 08:44:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10420681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 63C326016C for ; Wed, 23 May 2018 08:46:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52DB928E86 for ; Wed, 23 May 2018 08:46:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 470BD28EAF; Wed, 23 May 2018 08:46:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BD85628E86 for ; Wed, 23 May 2018 08:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=VViMZ5iCU1yxaUTWF7mijtYVHdZnHpF3NQvlSZUGjHk=; b=clN MeehDzZzULej6a3sF+ONgFEH4GdtpqOPKuIksGFrpkCaA7aKl1t1GUiettjF+IImol+RHPXJeOqYi AXgNxkitY6zTa6qptqMIICWKe2C8R9uUiaYUqD+p34tYJmiDwEPTqZ8rZZKMuGW4ij1x6CRbRshrY jTJ/gRY3hW/Oy6FthAzDfV9g+UbQXs06eFXnMt4OXfXuJ//ZaEQuWnoZngsU5QImGuTBKXjHB3DZf 4lragpr4fB182XOkpMm2wLen5r3B9UQAgZAZUqXbVgZLGCBiiJPWxvQ501iqAm7MnLLfdasUoBdA6 SFLcqTZQmrbmRkDkZ0J5EIc5951mnYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLPPL-0003e7-TF; Wed, 23 May 2018 08:46:07 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLPNt-0001XZ-0Y for linux-arm-kernel@lists.infradead.org; Wed, 23 May 2018 08:45:33 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id A1B7120720; Wed, 23 May 2018 10:44:24 +0200 (CEST) Received: from localhost (unknown [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 6EEE42036F; Wed, 23 May 2018 10:44:14 +0200 (CEST) From: Gregory CLEMENT To: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: armada-37xx: Fix spurious irq management Date: Wed, 23 May 2018 10:44:05 +0200 Message-Id: <20180523084405.14410-1-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180523_014437_203552_C9DE24E2 X-CRM114-Status: GOOD ( 12.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Jason Cooper , Hua Jing , Antoine Tenart , Gregory CLEMENT , stable@vger.kernel.org, Maxime Chevallier , Nadav Haklai , Victor Gu , Neta Zur Hershkovits , Thomas Petazzoni , =?UTF-8?q?Miqu=C3=A8l=20Raynal?= , Terry Zhou , Marcin Wojtas , Wilson Ding , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Terry Zhou Until now, if we found spurious irq in irq_handler, we only updated the status in register but not the status in the code. Due to this the system will got stuck dues to the infinite loop [gregory.clement@bootlin.com: update comment and add fix and stable tags] Fixes: 30ac0d3b0702 ("pinctrl: armada-37xx: Add edge both type gpio irq support") Cc: Signed-off-by: Terry Zhou Reviewed-by: Gregory CLEMENT Signed-off-by: Gregory CLEMENT --- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 5b63248c8209..7bef929bd7fe 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -679,12 +679,13 @@ static void armada_37xx_irq_handler(struct irq_desc *desc) writel(1 << hwirq, info->base + IRQ_STATUS + 4 * i); - continue; + goto update_status; } } generic_handle_irq(virq); +update_status: /* Update status in case a new IRQ appears */ spin_lock_irqsave(&info->irq_lock, flags); status = readl_relaxed(info->base +