From patchwork Wed Jun 4 12:47:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 31358 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C3DD203AC for ; Wed, 4 Jun 2014 13:17:35 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf42241740obc.8 for ; Wed, 04 Jun 2014 06:17:34 -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: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=irwrsEKj1i1DNm/FuUxJlpovufx4ImNWH5p7Qo8PEl8=; b=lmkiM5sk7utiwhjkCEssvRMRByGWxDScPp1y+yPgTmRI8ss0BaFIT9rsVXk+aqqTT2 mBe9TdyUIA5aiO8uVVd+OH8Pq3L61fY/s8ae+Wb621l4n5hOI4k1+c2BfMwnhLatoeqo 3AN77iNFRIGURbfCQh2QSsyH5ykeKIG56nAbee6cjOP6ivX4Ue1IMFp1oX07Ugv+2itU pkxMP+tlur/48ig1Ua/ov2ssE/0yWeSkfHuWY7VOnE4JKcxq2aK4yHnTyB9IgTpLOLDF pcpFEY/wpjQGTxdrMYrlONgscFcoXQwuijTwmuTS38CJLyJyPCVu/Uea40a0eiH5k7ik K9ew== X-Gm-Message-State: ALoCoQkKNinbKLjWD0ORgqYg1Kz1gmDwHo1rk0Wq92bwyxjXTPBjjxM0hSAR9EMSd1ifz6EOobON X-Received: by 10.50.6.80 with SMTP id y16mr2179764igy.1.1401887854883; Wed, 04 Jun 2014 06:17:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.234 with SMTP id a97ls2974388qgf.51.gmail; Wed, 04 Jun 2014 06:17:34 -0700 (PDT) X-Received: by 10.220.81.194 with SMTP id y2mr3827254vck.29.1401887854719; Wed, 04 Jun 2014 06:17:34 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id kb8si567202vec.96.2014.06.04.06.17.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Jun 2014 06:17:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id oy12so8822719veb.10 for ; Wed, 04 Jun 2014 06:17:34 -0700 (PDT) X-Received: by 10.58.186.207 with SMTP id fm15mr44076570vec.4.1401887854633; Wed, 04 Jun 2014 06:17:34 -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 vs6csp44236vcb; Wed, 4 Jun 2014 06:17:34 -0700 (PDT) X-Received: by 10.140.80.67 with SMTP id b61mr67397012qgd.98.1401887854021; Wed, 04 Jun 2014 06:17:34 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id q65si3496842qga.96.2014.06.04.06.17.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jun 2014 06:17:34 -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 1WsB2z-0006kl-Mb; Wed, 04 Jun 2014 13:16:05 +0000 Received: from mail-wi0-f177.google.com ([209.85.212.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WsB2w-0006gp-Vv for linux-arm-kernel@lists.infradead.org; Wed, 04 Jun 2014 13:16:03 +0000 Received: by mail-wi0-f177.google.com with SMTP id f8so1442914wiw.10 for ; Wed, 04 Jun 2014 06:15:38 -0700 (PDT) X-Received: by 10.194.142.205 with SMTP id ry13mr4628484wjb.69.1401886056953; Wed, 04 Jun 2014 05:47:36 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id i6sm9500430wiy.17.2014.06.04.05.47.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jun 2014 05:47:35 -0700 (PDT) From: Linus Walleij To: arm@kernel.org Subject: [PATCH v2] ARM: integrator: fix section mismatch problem Date: Wed, 4 Jun 2014 14:47:28 +0200 Message-Id: <1401886048-22209-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140604_061603_173335_9049957D X-CRM114-Status: GOOD ( 21.78 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.177 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Cc: Linus Walleij , Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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: linus.walleij@linaro.org 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.179 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 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: Arnd Bergmann Cc: Russell King Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Suppress sysfs bind/unbind for the IM-PD1 ARM SoC folks: please apply this directly if the solution seems acceptable. --- 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 ba43321001d8..64f8e2564a37 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 0e870ea818c4..3ce880729cff 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,