All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (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	[thread overview]
Message-ID: <1402675276-538682-9-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1402675276-538682-1-git-send-email-arnd@arndb.de>

From: Linus Walleij <linus.walleij@linaro.org>

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 <linux@arm.linux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 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,
-- 
1.8.3.2

  parent reply	other threads:[~2014-06-13 16:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13 16:01 [PATCH 00/14] arm-soc fixes for 3.16 review Arnd Bergmann
2014-06-13 16:01 ` Arnd Bergmann
2014-06-13 16:01 ` [PATCH 01/14] ARM: mvebu: fix randconfig builds for pmsu driver Arnd Bergmann
2014-06-17 14:00   ` Thomas Petazzoni
2014-06-17 15:03     ` Arnd Bergmann
2014-06-17 15:17       ` Thomas Petazzoni
2014-06-17 15:20         ` Arnd Bergmann
2014-06-13 16:01 ` [PATCH 02/14] ARM: omap2: fix am43xx dependency on l2x0 cache Arnd Bergmann
2014-06-13 16:01   ` Arnd Bergmann
2014-06-16  9:41   ` Tony Lindgren
2014-06-16  9:41     ` Tony Lindgren
2014-06-13 16:01 ` [PATCH 03/14] ARM: keystone requires ARM_PATCH_PHYS_VIRT Arnd Bergmann
2014-06-13 16:23   ` Santosh Shilimkar
2014-06-18 14:39   ` Rob Herring
2014-06-18 15:16     ` Arnd Bergmann
2014-06-18 15:49   ` Nicolas Pitre
2014-06-13 16:01 ` [PATCH 04/14] bus/arm-cci: add dependency on OF && CPU_V7 Arnd Bergmann
2014-06-13 16:01 ` [PATCH 05/14] remoteproc: da8xx: don't select CMA on no-MMU Arnd Bergmann
2014-06-13 16:01 ` [PATCH 06/14] ARM: samsung: make SAMSUNG_DMADEV optional Arnd Bergmann
2014-06-13 16:01 ` [PATCH 07/14] ARM: mvebu: DT: fix OpenBlocks AX3-4 RAM size Arnd Bergmann
2014-06-13 16:01 ` Arnd Bergmann [this message]
2014-06-13 16:01 ` [PATCH 09/14] ARM: Remove ARCH_HAS_CPUFREQ config option Arnd Bergmann
2014-06-13 16:01 ` [PATCH 10/14] misc: vexpress: fix error handling vexpress_syscfg_regmap_init() Arnd Bergmann
2014-06-13 16:01 ` [PATCH 11/14] ARM: exynos: cleanup kconfig option display Arnd Bergmann
2014-06-13 16:01   ` Arnd Bergmann
2014-06-13 16:01 ` [PATCH 12/14] ARM: use menuconfig for sub-arch menus Arnd Bergmann
2014-06-13 16:01 ` [PATCH 13/14] ARM: exynos: move sysram info to exynos.c Arnd Bergmann
2014-06-13 16:01 ` [PATCH 14/14] ARM: EXYNOS: Fix compilation warning Arnd Bergmann
2014-06-13 20:40 ` [PATCH 00/14] arm-soc fixes for 3.16 review Jason Cooper
2014-06-13 20:40   ` Jason Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402675276-538682-9-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.