From patchwork Sat Apr 26 19:34:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 4069481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ED888BFF02 for ; Sat, 26 Apr 2014 19:38:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C31720251 for ; Sat, 26 Apr 2014 19:38:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2928020218 for ; Sat, 26 Apr 2014 19:38:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1We8NI-0005e4-RZ; Sat, 26 Apr 2014 19:35:00 +0000 Received: from mail-ee0-x22f.google.com ([2a00:1450:4013:c00::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1We8NA-0005cV-88 for linux-arm-kernel@lists.infradead.org; Sat, 26 Apr 2014 19:34:53 +0000 Received: by mail-ee0-f47.google.com with SMTP id b15so3668269eek.34 for ; Sat, 26 Apr 2014 12:34:29 -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=pt/9O9+TxUGCcRHRb4hvRVryJF049M09yLnUr/fmp08=; b=bvpvzQt+7LaNbK2h47i+lAZ48U5jbmOMiZRRRyBmfsvQcdofL9v3GHBq4krMLWjs3V 5kDJDrpqEulhqC6dew0CSOKXLF1PWKLpTDCyqxedEn2LKQbdfwY05FcOIs5a6xEzTuyp y84Iod/uZDCPKXdU0n87a//b/mpBeozq+sAOkJfGVG/WRfNBG3rhdh62sMxu3U5J4p86 2v9O3991vhkZ6+KwTsHFzdS71OlIgDqRefaBR639MWYsx65d9gjIG0rq4DPSLiy7mEsr ZAnX5xYoOtJXmQ5gv5CRMPGudozXGW0yHe0uyG7gmxNCbJp4wu+UBLAY8s27ieoyDZOS 1Vkw== X-Received: by 10.15.43.132 with SMTP id x4mr230559eev.59.1398540869794; Sat, 26 Apr 2014 12:34:29 -0700 (PDT) Received: from topkick.lan (dslc-082-083-251-183.pools.arcor-ip.net. [82.83.251.183]) by mx.google.com with ESMTPSA id h47sm35646095eey.13.2014.04.26.12.34.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Apr 2014 12:34:28 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH RESEND 3/3] irqchip: orion: reverse irq handling priority Date: Sat, 26 Apr 2014 21:34:15 +0200 Message-Id: <1398540855-27367-4-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1398540855-27367-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1398540855-27367-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140426_123452_461349_7914C887 X-CRM114-Status: GOOD ( 11.11 ) X-Spam-Score: -0.1 (/) Cc: Andrew Lunn , Jason Cooper , linux-kernel@vger.kernel.org, Gregory Clement , Thomas Gleixner , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Non-DT irq handlers were working through irq causes from most-significant to least-significant bit, while DT irqchip driver does it the other way round. This revealed some more HW issues on Kirkwood peripheral IP, where spurious sdio irqs can happen although IP's irq enable registers are all zero. Although, not directly related with the described issue, reverse irq bit handling back to original order by replacing ffs() with fls(). Signed-off-by: Sebastian Hesselbarth Acked-by: Jason Cooper --- Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/irqchip/irq-orion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-orion.c b/drivers/irqchip/irq-orion.c index e25f246cd2fb..34d18b48bb78 100644 --- a/drivers/irqchip/irq-orion.c +++ b/drivers/irqchip/irq-orion.c @@ -42,7 +42,7 @@ __exception_irq_entry orion_handle_irq(struct pt_regs *regs) u32 stat = readl_relaxed(gc->reg_base + ORION_IRQ_CAUSE) & gc->mask_cache; while (stat) { - u32 hwirq = ffs(stat) - 1; + u32 hwirq = __fls(stat); u32 irq = irq_find_mapping(orion_irq_domain, gc->irq_base + hwirq); handle_IRQ(irq, regs); @@ -117,7 +117,7 @@ static void orion_bridge_irq_handler(unsigned int irq, struct irq_desc *desc) gc->mask_cache; while (stat) { - u32 hwirq = ffs(stat) - 1; + u32 hwirq = __fls(stat); generic_handle_irq(irq_find_mapping(d, gc->irq_base + hwirq)); stat &= ~(1 << hwirq);