summaryrefslogtreecommitdiff
path: root/arch/arc/kernel/smp.c
diff options
context:
space:
mode:
authorNoam Camus <noamca@mellanox.com>2016-10-30 09:48:42 +0200
committerVineet Gupta <vgupta@synopsys.com>2016-10-31 17:12:41 -0700
commit8f6d9eb2a3f38f1acd04efa0aeb8b81f5373c923 (patch)
treeadf0f7a698653109101927ef4e6bdf0f457361e1 /arch/arc/kernel/smp.c
parent6227e9f0e9ee988e2cfb425b02ef17f233b1d8d7 (diff)
ARC: [SMP] avoid overriding present cpumask
At smp_prepare_cpus() we set present cpu mask as part of init for all CPUs at range [0-max_cpus]. This is done without checking if this mask is already being set. At platform of eznps this mask is already being initialized at smp_init_cpus() by using hook plat_smp_ops.init_early_smp(). So to avoid overriding of present cpu mask we check the number of bits which are set in this mask. At the begin only bit for boot CPU is set so if number of bits already set is no more than one we can be assure that there is no overriding of this mask. Signed-off-by: Noam Camus <noamca@mellanox.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel/smp.c')
-rw-r--r--arch/arc/kernel/smp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index f183cc648851..f00029e9cbe4 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -67,11 +67,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
int i;
/*
- * Initialise the present map, which describes the set of CPUs
- * actually populated at the present time.
+ * if platform didn't set the present map already, do it now
+ * boot cpu is set to present already by init/main.c
*/
- for (i = 0; i < max_cpus; i++)
- set_cpu_present(i, true);
+ if (num_present_cpus() <= 1) {
+ for (i = 0; i < max_cpus; i++)
+ set_cpu_present(i, true);
+ }
}
void __init smp_cpus_done(unsigned int max_cpus)