From patchwork Tue Mar 29 18:15:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 8689321 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0A911C0553 for ; Tue, 29 Mar 2016 18:19:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D35C20379 for ; Tue, 29 Mar 2016 18:19:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2085620374 for ; Tue, 29 Mar 2016 18:19:52 +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 1akyCZ-0006Iu-5P; Tue, 29 Mar 2016 18:17:15 +0000 Received: from bh-25.webhostbox.net ([208.91.199.152]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1akyCX-0005Zn-2l for linux-arm-kernel@lists.infradead.org; Tue, 29 Mar 2016 18:17:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=4gaolm4ZXAuxaQr+iJp3prlG1nj6qhczWSH7sL0X/w8=; b=dNZnum7WpOHjwtWoMgmIo9Oxjh +Lh5vxOAIAFsoRQSIeLG8w+9DhqcaxjuwZlUm5eQ/or/gDbBz9dEOTL22Of0riDOqDCbOFhN+QupE gqgD89Wp76d2C9kz8i5Vj109H8fFIN5xnhKFgIrhJf2zeWYAgKNbPYtEVvx848jDn1Ypy/lanmcUc bEe8MpyhXU4Dux8PowVBRR5O985HMZPv66oA3KTpNb9YBUGY37A6SNMXFczZTlzScds24mj7IFsBJ Vc4CN8C2tKth4h7W3Y8y8gjsWfOjG94Lfg9XOXEnma3JRwAYqGQ31RPEbn1AGZtbAaFcoQgNZwiEr 4+zqe/sQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:41970 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1akyBB-001rIu-1n; Tue, 29 Mar 2016 18:15:49 +0000 From: Guenter Roeck To: Russell King Subject: [PATCH] ARM: sa1100: Initialize gpio after gpio subsystem has been initialized Date: Tue, 29 Mar 2016 11:15:49 -0700 Message-Id: <1459275349-11356-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=1.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160329_111713_203133_FFCF12CD X-CRM114-Status: UNSURE ( 8.88 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.5 (/) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , Guenter Roeck , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,SUSPICIOUS_RECIPS,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 The sa1100 gpio driver was initialized from interrupt initialization code, which is earlier than the gpio subsystem is initialized. Since commit ff2b13592299 ("gpio: make the gpiochip a real device"), this is fatal and causes the system to crash. The sa1100 gpio driver must be initialized prior to arch_initcall, since its gpio pins are used in arch_initcall code, but after the gpio subsystem is initialized (core_initcall). Initialize it with postcore_initcall. Fixes: ff2b13592299 ("gpio: make the gpiochip a real device") Cc: Linus Walleij Signed-off-by: Guenter Roeck --- Tested by building collie_defconfig and: qemu-system-arm -M collie -kernel arch/arm/boot/zImage \ -no-reboot -initrd busybox-armv4.cpio \ --append "rdinit=/sbin/init console=ttySA1" -monitor null -nographic arch/arm/mach-sa1100/generic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 345e63f4eb71..850aa7f8f649 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -321,6 +321,15 @@ static int __init sa1100_init(void) arch_initcall(sa1100_init); +static int __init sa1100_gpio_init(void) +{ + sa1100_init_gpio(); + + return 0; +} + +postcore_initcall(sa1100_gpio_init); + void __init sa11x0_init_late(void) { sa11x0_pm_init(); @@ -386,8 +395,6 @@ void __init sa1100_init_irq(void) request_resource(&iomem_resource, &irq_resource); sa11x0_init_irq_nodt(IRQ_GPIO0_SC, irq_resource.start); - - sa1100_init_gpio(); } /*