From patchwork Fri Jun 13 16:01:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4350431 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 E873FBEEAA for ; Fri, 13 Jun 2014 16:07:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1118120222 for ; Fri, 13 Jun 2014 16:07:03 +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 E18CD201B9 for ; Fri, 13 Jun 2014 16:07:01 +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 1WvTxV-0005Jh-HG; Fri, 13 Jun 2014 16:04:05 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvTvU-0003pC-8S for linux-arm-kernel@lists.infradead.org; Fri, 13 Jun 2014 16:02:04 +0000 Received: from wuerfel.lan (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue007) with ESMTP (Nemesis) id 0MRvbR-1XJRtQ25tJ-00T0E5; Fri, 13 Jun 2014 18:01:29 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/14] ARM: integrator: fix section mismatch problem Date: Fri, 13 Jun 2014 18:01:10 +0200 Message-Id: <1402675276-538682-9-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1402675276-538682-1-git-send-email-arnd@arndb.de> References: <1402675276-538682-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:AVVv4PruzMfIsO7lnGREGW4PJ6c+FT0oguIaJ6b8TYL 0fnHzxngF6E2XBjvmpZtsf86FOPYtzC11w3zqjJ/4uFEpA3Z7d pkbNmDxNU1YDoEEtmd9f05vjjqkB4TJZu+Pc0AFky07E0/4p9M QWn6SMtfJPqbzFSVksgUQBtrwkOdqbuQhfVXqVIcVtSXjlraz8 6O3+msIAq5qHXzFbXml+03XqvwvvV8209LsOCLKW5eetl0a75j Fe/IOvhnmVuIcyW0Joi2OZRvmvPrtZ/KnmOaoBmDDMSlQDWke+ 6/3kQULaIsBbXkxQa2TE6r99vPwRgp0QS842NLXCtiMcFlehJf ZDUhAilLka9L4skhXqdX6LF3PiJBQt4xGVMcoabVz X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140613_090200_715247_E7771AE7 X-CRM114-Status: GOOD ( 19.07 ) X-Spam-Score: -0.0 (/) Cc: Linus Walleij , arm@kernel.org, Russell King , Arnd Bergmann 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.5 required=5.0 tests=BAYES_00,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 From: Linus Walleij This addresses a section mismatch problem in the IM-PD1 driver in the Integrator/AP. The IM-PD1 contains a VIC interrupt controller and therefore the driver calls vic_init_cascaded() which is marked __init as irqchips are simply not hot-pluggable and specifically the VIC is assumed to initiate only on boot. However the module driver model of the Integrator LM bus assumes that logic tile drivers can be probed at runtime. This is not really the case for IM-PD1: these tiles are detected at boot and they cannot be plugged into a running system. Before this patch it is of course possible to modprobe them later. By first forcing the IM-PD1 to bool we make sure this driver gets compiled into the kernel, and we know it will be probed only at boot time when the tiles are detected, so we can tag its probe function __init_refok as we know it won't be called after boot now, and the section mismatch problem goes away. As a side effect, sysfs binding from userspace becomes impossible, so we tag the driver to suppress the bind/unbind sysfs attributes. Cc: Russell King Signed-off-by: Linus Walleij Signed-off-by: Arnd Bergmann --- arch/arm/mach-integrator/Kconfig | 2 +- arch/arm/mach-integrator/impd1.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index ba43321..64f8e25 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig @@ -28,7 +28,7 @@ config ARCH_CINTEGRATOR bool config INTEGRATOR_IMPD1 - tristate "Include support for Integrator/IM-PD1" + bool "Include support for Integrator/IM-PD1" depends on ARCH_INTEGRATOR_AP select ARCH_REQUIRE_GPIOLIB select ARM_VIC diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 0e870ea..3ce8807 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c @@ -308,7 +308,12 @@ static struct impd1_device impd1_devs[] = { */ #define IMPD1_VALID_IRQS 0x00000bffU -static int __init impd1_probe(struct lm_device *dev) +/* + * As this module is bool, it is OK to have this as __init_refok() - no + * probe calls will be done after the initial system bootup, as devices + * are discovered as part of the machine startup. + */ +static int __init_refok impd1_probe(struct lm_device *dev) { struct impd1_module *impd1; int irq_base; @@ -397,6 +402,11 @@ static void impd1_remove(struct lm_device *dev) static struct lm_driver impd1_driver = { .drv = { .name = "impd1", + /* + * As we're dropping the probe() function, suppress driver + * binding from sysfs. + */ + .suppress_bind_attrs = true, }, .probe = impd1_probe, .remove = impd1_remove,