aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup_64.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-03-15 23:54:35 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-19 21:03:24 -0400
commit9d07bc841c9779b4d7902e417f4e509996ce805d (patch)
tree7a381096d3da7497aac58c4ec18c74299ee47fb4 /arch/powerpc/kernel/setup_64.c
parentad0693ee722b93b63a89c845e99513f242e43aa6 (diff)
powerpc: Properly handshake CPUs going out of boot spin loop
We need to wait a bit for them to have done their CPU setup or we might end up with translation and EE on with different LPCR values between threads Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r--arch/powerpc/kernel/setup_64.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 5a0401fcaeb..91a5cc5f0d0 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -72,6 +72,7 @@
72#endif 72#endif
73 73
74int boot_cpuid = 0; 74int boot_cpuid = 0;
75int __initdata boot_cpu_count;
75u64 ppc64_pft_size; 76u64 ppc64_pft_size;
76 77
77/* Pick defaults since we might want to patch instructions 78/* Pick defaults since we might want to patch instructions
@@ -233,6 +234,7 @@ void early_setup_secondary(void)
233void smp_release_cpus(void) 234void smp_release_cpus(void)
234{ 235{
235 unsigned long *ptr; 236 unsigned long *ptr;
237 int i;
236 238
237 DBG(" -> smp_release_cpus()\n"); 239 DBG(" -> smp_release_cpus()\n");
238 240
@@ -245,7 +247,16 @@ void smp_release_cpus(void)
245 ptr = (unsigned long *)((unsigned long)&__secondary_hold_spinloop 247 ptr = (unsigned long *)((unsigned long)&__secondary_hold_spinloop
246 - PHYSICAL_START); 248 - PHYSICAL_START);
247 *ptr = __pa(generic_secondary_smp_init); 249 *ptr = __pa(generic_secondary_smp_init);
248 mb(); 250
251 /* And wait a bit for them to catch up */
252 for (i = 0; i < 100000; i++) {
253 mb();
254 HMT_low();
255 if (boot_cpu_count == 0)
256 break;
257 udelay(1);
258 }
259 DBG("boot_cpu_count = %d\n", boot_cpu_count);
249 260
250 DBG(" <- smp_release_cpus()\n"); 261 DBG(" <- smp_release_cpus()\n");
251} 262}