From patchwork Fri Nov 15 14:22:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 3188501 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 99A649F39E for ; Fri, 15 Nov 2013 14:40:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5CC82030D for ; Fri, 15 Nov 2013 14:40:22 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D98C202EC for ; Fri, 15 Nov 2013 14:40:21 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKJF-0003eb-F1; Fri, 15 Nov 2013 14:23:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKIr-0000dT-Na; Fri, 15 Nov 2013 14:23:21 +0000 Received: from mail-bk0-x22a.google.com ([2a00:1450:4008:c01::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKIb-0000Xt-3E for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2013 14:23:06 +0000 Received: by mail-bk0-f42.google.com with SMTP id w16so1687992bkz.1 for ; Fri, 15 Nov 2013 06:22:43 -0800 (PST) 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=TL2eAf5MFkbfpAZVsKUmS4OK9dSeBiQrq9A9h6DXKIw=; b=frSohaMMLXmwuiwujOg+RZi6QTCIf7gAiHsWB4P+kWJYLph1Jt+U4ZE1mEHEBYJRUM rpSMqESkGq4e0uqANVSEuT/Jvk6clqhTyx6/piK24KcR+qUWg74owYajTa0zArQ7LSuP TAZkCtpRe1x9KnXnCxTJGptdjw4ewE9PTUZ+NAdQClnVmt+Zgh3EjJaGtRj7tFMU7NF4 J9okhUuSFIIpuXScAECI4BLY2T8SVWItigtL2moZeAqO3V36r+mpAuroqmIssNukpmlV TKbhfSTzaGIvtAj+Riat6NZ+hTIak6ULaRPA/C/qoAFWs3ezbduXIC0VLIWUPnd34IQO XuMA== X-Received: by 10.205.36.202 with SMTP id tb10mr493bkb.119.1384525363199; Fri, 15 Nov 2013 06:22:43 -0800 (PST) Received: from topkick.lan (dslc-082-083-251-183.pools.arcor-ip.net. [82.83.251.183]) by mx.google.com with ESMTPSA id pk7sm7168376bkb.2.2013.11.15.06.22.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2013 06:22:42 -0800 (PST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH 1/3] irqchip: orion: reverse irq handling priority Date: Fri, 15 Nov 2013 15:22:32 +0100 Message-Id: <1384525354-901-2-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1384525354-901-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1384525354-901-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131115_092305_297402_93CC3CA9 X-CRM114-Status: GOOD ( 13.53 ) X-Spam-Score: -2.0 (--) Cc: Andrew Lunn , Russell King , Jason Cooper , linux-kernel@vger.kernel.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth 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=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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: Thomas Gleixner Cc: Jason Cooper Cc: Andrew Lunn Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/irqchip/irq-orion.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-orion.c b/drivers/irqchip/irq-orion.c index e51d400..de30d5c 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); @@ -116,7 +116,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);