diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2014-06-04 08:47:28 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2014-06-17 11:09:38 -0400 |
commit | e1318391fda4060b77d638fa1d2e1987590c7d45 (patch) | |
tree | 2ed85679e7bff9bf124ae31157f17ac136dfde31 /arch | |
parent | e47043aea3853a74a9aa5726a1faa916d7462ab7 (diff) |
ARM: integrator: fix section mismatch problem
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-integrator/Kconfig | 2 | ||||
-rw-r--r-- | 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 | |||
28 | bool | 28 | bool |
29 | 29 | ||
30 | config INTEGRATOR_IMPD1 | 30 | config INTEGRATOR_IMPD1 |
31 | tristate "Include support for Integrator/IM-PD1" | 31 | bool "Include support for Integrator/IM-PD1" |
32 | depends on ARCH_INTEGRATOR_AP | 32 | depends on ARCH_INTEGRATOR_AP |
33 | select ARCH_REQUIRE_GPIOLIB | 33 | select ARCH_REQUIRE_GPIOLIB |
34 | select ARM_VIC | 34 | 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[] = { | |||
308 | */ | 308 | */ |
309 | #define IMPD1_VALID_IRQS 0x00000bffU | 309 | #define IMPD1_VALID_IRQS 0x00000bffU |
310 | 310 | ||
311 | static int __init impd1_probe(struct lm_device *dev) | 311 | /* |
312 | * As this module is bool, it is OK to have this as __init_refok() - no | ||
313 | * probe calls will be done after the initial system bootup, as devices | ||
314 | * are discovered as part of the machine startup. | ||
315 | */ | ||
316 | static int __init_refok impd1_probe(struct lm_device *dev) | ||
312 | { | 317 | { |
313 | struct impd1_module *impd1; | 318 | struct impd1_module *impd1; |
314 | int irq_base; | 319 | int irq_base; |
@@ -397,6 +402,11 @@ static void impd1_remove(struct lm_device *dev) | |||
397 | static struct lm_driver impd1_driver = { | 402 | static struct lm_driver impd1_driver = { |
398 | .drv = { | 403 | .drv = { |
399 | .name = "impd1", | 404 | .name = "impd1", |
405 | /* | ||
406 | * As we're dropping the probe() function, suppress driver | ||
407 | * binding from sysfs. | ||
408 | */ | ||
409 | .suppress_bind_attrs = true, | ||
400 | }, | 410 | }, |
401 | .probe = impd1_probe, | 411 | .probe = impd1_probe, |
402 | .remove = impd1_remove, | 412 | .remove = impd1_remove, |