From patchwork Wed Sep 21 13:24:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4218 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 81CBB23EF6 for ; Wed, 21 Sep 2011 13:14:31 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 648A0A18D20 for ; Wed, 21 Sep 2011 13:14:31 +0000 (UTC) Received: by fxe23 with SMTP id 23so2272522fxe.11 for ; Wed, 21 Sep 2011 06:14:31 -0700 (PDT) Received: by 10.223.61.66 with SMTP id s2mr1062367fah.27.1316610871186; Wed, 21 Sep 2011 06:14:31 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.18.198 with SMTP id y6cs125893lad; Wed, 21 Sep 2011 06:14:30 -0700 (PDT) Received: by 10.224.207.73 with SMTP id fx9mr624824qab.114.1316610869993; Wed, 21 Sep 2011 06:14:29 -0700 (PDT) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe005.messaging.microsoft.com. [216.32.181.185]) by mx.google.com with ESMTPS id ee9si3838323qab.65.2011.09.21.06.14.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Sep 2011 06:14:29 -0700 (PDT) Received-SPF: neutral (google.com: 216.32.181.185 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=216.32.181.185; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.181.185 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: from mail192-ch1-R.bigfish.com (216.32.181.174) by CH1EHSOBE018.bigfish.com (10.43.70.68) with Microsoft SMTP Server id 14.1.225.22; Wed, 21 Sep 2011 13:14:29 +0000 Received: from mail192-ch1 (localhost.localdomain [127.0.0.1]) by mail192-ch1-R.bigfish.com (Postfix) with ESMTP id 0148E1680222; Wed, 21 Sep 2011 13:14:29 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail192-ch1 (localhost.localdomain [127.0.0.1]) by mail192-ch1 (MessageSwitch) id 1316610868258976_20171; Wed, 21 Sep 2011 13:14:28 +0000 (UTC) Received: from CH1EHSMHS032.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.254]) by mail192-ch1.bigfish.com (Postfix) with ESMTP id 38D67F0804C; Wed, 21 Sep 2011 13:14:28 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS032.bigfish.com (10.43.70.32) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 21 Sep 2011 13:14:25 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.323.7; Wed, 21 Sep 2011 08:14:24 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p8LDELVm014550; Wed, 21 Sep 2011 08:14:22 -0500 (CDT) From: Shawn Guo To: Grant Likely CC: Jamie Iles , , , , Shawn Guo Subject: [PATCH] gpio/mxc: add chained_irq_enter/exit() to mx3_gpio_irq_handler() Date: Wed, 21 Sep 2011 21:24:04 +0800 Message-ID: <1316611444-14126-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com The mx3_gpio_irq_handler() is also called on imx6q which has GIC as the primary interrupt controller. As GIC implements the fasteoi flow control, we need to add chained_irq_enter/exit() to mx3_gpio_irq_handler() for signaling EOI, otherwise system will hang whenever there is a gpio irq triggered. Signed-off-by: Shawn Guo --- This is the second post of '[PATCH] gpio/mxc: make it work with imx6q' to adopt the point given by Jamie. drivers/gpio/gpio-mxc.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 4340aca..82f7b65 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -30,6 +30,7 @@ #include #include #include +#include enum mxc_gpio_hwtype { IMX1_GPIO, /* runs on i.mx1 */ @@ -232,10 +233,15 @@ static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc) { u32 irq_stat; struct mxc_gpio_port *port = irq_get_handler_data(irq); + struct irq_chip *chip = irq_get_chip(irq); + + chained_irq_enter(chip, desc); irq_stat = readl(port->base + GPIO_ISR) & readl(port->base + GPIO_IMR); mxc_gpio_irq_handler(port, irq_stat); + + chained_irq_exit(chip, desc); } /* MX2 has one interrupt *for all* gpio ports */