From patchwork Thu Nov 27 18:42:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 5398911 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 F2FAFBF0E3 for ; Thu, 27 Nov 2014 18:45:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11621201C8 for ; Thu, 27 Nov 2014 18:45:26 +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 36A91201E4 for ; Thu, 27 Nov 2014 18:45:25 +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 1Xu42F-000297-1L; Thu, 27 Nov 2014 18:43:23 +0000 Received: from smtp01.smtpout.orange.fr ([80.12.242.123] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xu41S-0001J9-0m for linux-arm-kernel@lists.infradead.org; Thu, 27 Nov 2014 18:42:35 +0000 Received: from beldin.home ([90.11.113.15]) by mwinf5d02 with ME id Lii31p0050KzNya03ii3Fs; Thu, 27 Nov 2014 19:42:10 +0100 X-ME-Helo: beldin.home X-ME-Date: Thu, 27 Nov 2014 19:42:10 +0100 X-ME-IP: 90.11.113.15 From: Robert Jarzmik To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Thomas Gleixner Subject: [PATCH] ARM: pxa: fix lubbock interrupts handling Date: Thu, 27 Nov 2014 19:42:01 +0100 Message-Id: <1417113721-9062-1-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141127_104234_399620_CD2A0396 X-CRM114-Status: GOOD ( 13.27 ) X-Spam-Score: 0.0 (/) Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_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 When gpio-pxa was moved to drivers/pxa, it became a driver, and its initialization and probing happen at postcore initcall. The lubbock code used to install the chained lubbock interrupt handler at init_irq() time. The consequence of the gpio-pxa change is that the installed chained irq handler lubbock_irq_handler() was overwritten in pxa_gpio_probe(_dt)(), removing : - the handler - the falling edge detection setting of GPIO0, which revealed the interrupt request from the lubbock IO board. As a fix, move the gpio0 chained handler setup to a place where we have the guarantee that pxa_gpio_probe() was called before, so that lubbock handler becomes the true IRQ chained handler of GPIO0, demuxing the lubbock IO board interrupts. Signed-off-by: Robert Jarzmik --- For Thomas: as a side note, I'm not very happy with this patch. What makes me unhappy is that I don't know how to express the dependency between gpio-pxa probe time and irq_set_chained_handler(irq, lubbock_irq_handler). At the moment I rely on the fact that lubbock_irq_device_init() is called as device initcall while pxa_gpio_probe() is called as postcore initcall. If you have a better idea I'm all ears. --- arch/arm/mach-pxa/lubbock.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index d8a1be6..1f138f9 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -172,9 +172,6 @@ static void __init lubbock_init_irq(void) handle_level_irq); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } - - irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lubbock_irq_handler); - irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING); } #ifdef CONFIG_PM @@ -190,7 +187,13 @@ static struct syscore_ops lubbock_irq_syscore_ops = { static int __init lubbock_irq_device_init(void) { + int irq; + if (machine_is_lubbock()) { + irq = PXA_GPIO_TO_IRQ(0); + irq_set_chained_handler(irq, lubbock_irq_handler); + irq_set_irq_type(irq, IRQ_TYPE_EDGE_FALLING); + register_syscore_ops(&lubbock_irq_syscore_ops); return 0; }