diff options
author | Thierry Reding <treding@nvidia.com> | 2014-07-11 13:00:37 +0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-07-17 16:58:41 +0400 |
commit | 05ccf19602cc16fc96401b4f2617d1b8e20e642d (patch) | |
tree | 0213edb6c6b8e0147c28b5785f5c966c4d0304a9 /arch/arm/mach-tegra/hotplug.c | |
parent | a2686766c81e18fb1ab9375cf5d3cbd54a3bed2c (diff) | |
download | linux-05ccf19602cc16fc96401b4f2617d1b8e20e642d.tar.xz |
ARM: tegra: Setup CPU hotplug in a pure initcall
CPU hotplug support doesn't have to be set up until fairly late in the
boot process, so it can be done in a regular initcall. To make sure that
we don't miss any ordering problems in the future, output a warning if
any of the functions are called before initialization has completed.
This is part of untangling the boot order dependencies on Tegra so that
more code can be shared between 32-bit and 64-bit ARM.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/hotplug.c')
-rw-r--r-- | arch/arm/mach-tegra/hotplug.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c index d60339c996cb..6fc71f1534b0 100644 --- a/arch/arm/mach-tegra/hotplug.c +++ b/arch/arm/mach-tegra/hotplug.c @@ -12,6 +12,7 @@ #include <linux/kernel.h> #include <linux/smp.h> +#include <soc/tegra/common.h> #include <soc/tegra/fuse.h> #include <asm/smp_plat.h> @@ -38,6 +39,11 @@ int tegra_cpu_kill(unsigned cpu) */ void __ref tegra_cpu_die(unsigned int cpu) { + if (!tegra_hotplug_shutdown) { + WARN(1, "hotplug is not yet initialized\n"); + return; + } + /* Clean L1 data cache */ tegra_disable_clean_inv_dcache(TEGRA_FLUSH_CACHE_LOUIS); @@ -48,10 +54,13 @@ void __ref tegra_cpu_die(unsigned int cpu) BUG(); } -void __init tegra_hotplug_init(void) +static int __init tegra_hotplug_init(void) { if (!IS_ENABLED(CONFIG_HOTPLUG_CPU)) - return; + return 0; + + if (!soc_is_tegra()) + return 0; if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_get_chip_id() == TEGRA20) tegra_hotplug_shutdown = tegra20_hotplug_shutdown; @@ -61,4 +70,7 @@ void __init tegra_hotplug_init(void) tegra_hotplug_shutdown = tegra30_hotplug_shutdown; if (IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC) && tegra_get_chip_id() == TEGRA124) tegra_hotplug_shutdown = tegra30_hotplug_shutdown; + + return 0; } +pure_initcall(tegra_hotplug_init); |