From patchwork Tue Nov 12 13:48:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3172441 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 2ED909F39E for ; Tue, 12 Nov 2013 13:51:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1156220164 for ; Tue, 12 Nov 2013 13:51:33 +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 BBDA12015A for ; Tue, 12 Nov 2013 13:51:31 +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 1VgELk-0005e9-Fe; Tue, 12 Nov 2013 13:49:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgELC-0005rx-Vx; Tue, 12 Nov 2013 13:49:14 +0000 Received: from mail-we0-f174.google.com ([74.125.82.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgEKz-0005nw-G8 for linux-arm-kernel@lists.infradead.org; Tue, 12 Nov 2013 13:49:08 +0000 Received: by mail-we0-f174.google.com with SMTP id t61so658053wes.33 for ; Tue, 12 Nov 2013 05:48:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bn7L9Drl3s9Q10Ko20hvDj92naB2NHgLjsfwAe46EQY=; b=BPbYyGhR2P97uUpEt8ZJC4mD+FnEEbrMQeueYDXPxREQyEXq9bblA97lp929q+ahGT UEzgxBzRd30Lqy/9L0kPtJ9ZtUqXyUofoNuPJMx2V9nesuVaWXRAYf6lUkhT9uvapfZy CtAuLff0Ln8SPMSl+vte1YpAs34CIYr/aWmK2fJqT4MyxVc3TYMxQn45OIz7JtRbMBvR XMkQSPhX+YmRG/W7NIcAvnabl50HDktSx/fHreNt0IAYuAJyYwYGwHZsVtoupvr7ctfB q56SFA2Dm/1jmjoRZEdQOSOJaodD3aWzaGemSIEYzReX9BWwzy1PR/NtAcfQgIPnnMB/ rj9w== X-Gm-Message-State: ALoCoQmnbrFZXppOMIijmsMg1019q3f9pm26cNlqqlK7EaX2fCHL1LUSJrBiyOxeC0APEUrXiKvN X-Received: by 10.180.39.205 with SMTP id r13mr16293994wik.55.1384264121352; Tue, 12 Nov 2013 05:48:41 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id pi6sm44704390wic.3.2013.11.12.05.48.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Nov 2013 05:48:40 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Russell King Subject: [PATCH 6/7] ARM: sa1100: rewrite the high GPIO IRQ handler Date: Tue, 12 Nov 2013 14:48:37 +0100 Message-Id: <1384264117-6396-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131112_084901_717681_CA21CD09 X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -2.6 (--) Cc: Dmitry Eremin-Solenikov , Dmitry Eremin-Solenikov , Dmitry Artamonow , Andrea Adami , Linus Walleij 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Simplify the handler for the high IRQs and follow the pattern of the ordinary "normal" IRQ handler. Signed-off-by: Linus Walleij --- arch/arm/mach-sa1100/irq.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index 5463ba521ac7..a6823f3281e2 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c @@ -106,34 +106,23 @@ static int sa1100_low_gpio_wake(struct irq_data *d, unsigned int on) } /* - * IRQ11 (GPIO11 through 27) handler. We enter here with the - * irq_controller_lock held, and IRQs disabled. Decode the IRQ + * High GPIO on IRQ11 (GPIO11 through 27) handler. We enter here with + * the irq_controller_lock held, and IRQs disabled. Decode the IRQ * and call the handler. */ static void sa1100_high_gpio_handler(unsigned int irq, struct irq_desc *desc) { - unsigned int mask; - - mask = GEDR & 0xfffff800; - do { - /* - * clear down all currently active IRQ sources. - * We will be processing them all. - */ - GEDR = mask; - - irq = IRQ_GPIO11; - mask >>= 11; - do { - if (mask & 1) - generic_handle_irq(irq); - mask >>= 1; - irq++; - } while (mask); - - mask = GEDR & 0xfffff800; - } while (mask); + struct irq_data *data = irq_desc_get_irq_data(desc); + struct sa1100_sc *sc = irq_data_get_irq_chip_data(data); + int hwirq; + u32 status; + + /* We're only interested in GPIOs 11 and upward */ + while ((status = (GEDR & 0xfffff800))) { + hwirq = ffs(status) - 1; + generic_handle_irq(irq_find_mapping(sc->high_domain, hwirq)); + } } /*