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: 21461 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2049723FBE for ; Tue, 12 Nov 2013 13:48:43 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id v1sf10274372yhn.0 for ; Tue, 12 Nov 2013 05:48:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=bn7L9Drl3s9Q10Ko20hvDj92naB2NHgLjsfwAe46EQY=; b=GpJE1UvbxX4yLEykAOTh0QjdHo+owpYF1PRfadQWIr9JXqgm29pwBYkXFJb4m9FeI4 Hxra1PnFq1F7N09WtBgIf09G/n/wK0jQer2vLc13oUFOPEjZVTZfNwpQgVmqxKLUF8BD YzILtZQ1H0QtPIc1CRr84KBpmNGY+ILY60a8JpmPDG1zrw3/W+TbGgebNotCvEpK3612 8f1mhN2U2BjUk7gaJNaiJe78fLoB2sNTFylscW10jXPTkC8TLGBtUGV8HvMEOZHjcHqp gEN7kjfcaSbGJXcXVpDT5DqqqEEJKZdiEtM/2mZYNi4hS3/ODW+1WHm/7n3GsyQzrhp/ I9LQ== X-Gm-Message-State: ALoCoQlu7X7Xdj3wycbo/2kGepPDLLE9dTtogO19a6zvHIKpz3fknalIkvoZ3IzqzIxdE1teL8B9 X-Received: by 10.58.2.98 with SMTP id 2mr10610033vet.3.1384264122792; Tue, 12 Nov 2013 05:48:42 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.226 with SMTP id nj2ls112544qeb.90.gmail; Tue, 12 Nov 2013 05:48:42 -0800 (PST) X-Received: by 10.52.65.136 with SMTP id x8mr9679983vds.23.1384264122700; Tue, 12 Nov 2013 05:48:42 -0800 (PST) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id pu5si12054017veb.97.2013.11.12.05.48.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Nov 2013 05:48:42 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id db12so1452974veb.15 for ; Tue, 12 Nov 2013 05:48:42 -0800 (PST) X-Received: by 10.220.145.75 with SMTP id c11mr1760116vcv.30.1384264122567; Tue, 12 Nov 2013 05:48:42 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp163936vcz; Tue, 12 Nov 2013 05:48:42 -0800 (PST) X-Received: by 10.180.84.101 with SMTP id x5mr16186487wiy.58.1384264121771; Tue, 12 Nov 2013 05:48:41 -0800 (PST) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by mx.google.com with ESMTPS id wy3si11663576wjc.103.2013.11.12.05.48.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Nov 2013 05:48:41 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.46 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=74.125.82.46; Received: by mail-wg0-f46.google.com with SMTP id x12so1547377wgg.13 for ; Tue, 12 Nov 2013 05:48:41 -0800 (PST) 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 Cc: Andrea Adami , Dmitry Eremin-Solenikov , Dmitry Artamonow , Dmitry Eremin-Solenikov , Linus Walleij 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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)); + } } /*