aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-06-20 16:46:01 +0100
committerNicolas Pitre <nicolas.pitre@linaro.org>2011-06-21 21:47:29 -0400
commitb634200930e34a1f586745fd38be3827686d1245 (patch)
treeb4d88fcc8c8dc4f61168bcabe7ef22ca3b835c58 /arch
parent19bdd31e732e367f62c3a8f8c9b8feee92cf33c6 (diff)
ARM: SMP: wait for CPU to be marked active
When we bring a CPU online, we should wait for it to become active before entering the idle thread, so we know that the scheduler and thread migration is going to work. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> (cherry picked from commit 573619d165b85152eeddd3b3871002c48cd94e42)
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/smp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 593345cb10e..e353a80581d 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -318,9 +318,13 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
smp_store_cpu_info(cpu);
/*
- * OK, now it's safe to let the boot CPU continue
+ * OK, now it's safe to let the boot CPU continue. Wait for
+ * the CPU migration code to notice that the CPU is online
+ * before we continue.
*/
set_cpu_online(cpu, true);
+ while (!cpu_active(cpu))
+ cpu_relax();
/*
* OK, it's off to the idle thread for us