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: 31881 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 305182054B for ; Fri, 13 Jun 2014 16:06:05 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id ft15sf9439009pdb.0 for ; Fri, 13 Jun 2014 09:06:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=4C4Xx0K1xEDBDuib+9X5K566Hu1z5OmpCjkWRKLCjyI=; b=fxNgND7ZqHkXBJg4Do77Wj8OP0d7QeLH13m28iOnSVhVVZ/d3XFAZr7jp1Aly2LEZ7 HLT4pqEeyAGqesPi/WGvidJrCde7dgUxeVht1tc01i7RdWFAwkJTSyddAJ7wMEbxX3mA U1hQFsVSzfQVYqZyFneGn8CVwgSn2fMr4st3wstXdpoqqNZW6RSBkTt90dBlr3OK1vGu eTeOWPQV7u6aDxXFyVf3EKRA0xX7EElauQc4k0OG+vTmWeSkXeS+ScqsnYpGNVjN2/Dr i6hOuJ8YqNT4QeyGFe9gbtRCuHf5tO8yK4EFDfdA29BcoSBwKuta2K7cDMvdInJbWZI0 KoCw== X-Gm-Message-State: ALoCoQni8yXHEMkSQBIugaqErQI/xNqHlDJGpD0rBSkLEdpaDhUEnNOBNWP4lyR4lonkIuHFH/Ws X-Received: by 10.68.195.9 with SMTP id ia9mr299116pbc.7.1402675564441; Fri, 13 Jun 2014 09:06:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.54 with SMTP id b51ls3547800qgf.48.gmail; Fri, 13 Jun 2014 09:06:04 -0700 (PDT) X-Received: by 10.52.120.75 with SMTP id la11mr1343654vdb.56.1402675564247; Fri, 13 Jun 2014 09:06:04 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id cp6si1539837vdc.95.2014.06.13.09.06.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 09:06:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.170 as permitted sender) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id i13so13758veh.29 for ; Fri, 13 Jun 2014 09:06:04 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr2068855vdd.24.1402675564153; Fri, 13 Jun 2014 09:06:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp503507vcb; Fri, 13 Jun 2014 09:06:03 -0700 (PDT) X-Received: by 10.140.27.23 with SMTP id 23mr4753148qgw.94.1402675563486; Fri, 13 Jun 2014 09:06:03 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id p10si4899035qci.12.2014.06.13.09.06.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jun 2014 09:06:03 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.131 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.131 listed in list.dnswl.org] 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: arnd@arndb.de X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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,