diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2011-07-06 20:56:51 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-07-07 09:45:07 -0400 |
commit | 7fa22bd5460bb2021729fa5a1012c60b9b3a56e2 (patch) | |
tree | f17dd732f1c915b52a3d5de968ed0e26596a4feb /arch/arm/kernel/smp.c | |
parent | 10cdc7e5129ac26aefece4c7a7d5b1a0285237c2 (diff) |
ARM: 6993/1: platsmp: Allow secondary cpu hotplug with maxcpus=1
If an ARM system has multiple cpus in the same socket and the
kernel is booted with maxcpus=1, secondary cpus are possible but
not present due to how platform_smp_prepare_cpus() is called.
Since most typical ARM processors don't actually support physical
hotplug, initialize the present map to be equal to the possible
map in generic ARM SMP code. Also, always call
platform_smp_prepare_cpus() as long as max_cpus is non-zero (0
means no SMP) to allow platform code to do any SMP setup.
After applying this patch it's possible to boot an ARM system
with maxcpus=1 on the command line and then hotplug in secondary
cpus via sysfs. This is more in line with how x86 does things.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: David Brown <davidb@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/smp.c')
-rw-r--r-- | arch/arm/kernel/smp.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 344e52b16c8c..0ffcf5c0da43 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -361,8 +361,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
361 | */ | 361 | */ |
362 | if (max_cpus > ncores) | 362 | if (max_cpus > ncores) |
363 | max_cpus = ncores; | 363 | max_cpus = ncores; |
364 | 364 | if (ncores > 1 && max_cpus) { | |
365 | if (max_cpus > 1) { | ||
366 | /* | 365 | /* |
367 | * Enable the local timer or broadcast device for the | 366 | * Enable the local timer or broadcast device for the |
368 | * boot CPU, but only if we have more than one CPU. | 367 | * boot CPU, but only if we have more than one CPU. |
@@ -370,6 +369,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
370 | percpu_timer_setup(); | 369 | percpu_timer_setup(); |
371 | 370 | ||
372 | /* | 371 | /* |
372 | * Initialise the present map, which describes the set of CPUs | ||
373 | * actually populated at the present time. A platform should | ||
374 | * re-initialize the map in platform_smp_prepare_cpus() if | ||
375 | * present != possible (e.g. physical hotplug). | ||
376 | */ | ||
377 | init_cpu_present(&cpu_possible_map); | ||
378 | |||
379 | /* | ||
373 | * Initialise the SCU if there are more than one CPU | 380 | * Initialise the SCU if there are more than one CPU |
374 | * and let them know where to start. | 381 | * and let them know where to start. |
375 | */ | 382 | */ |