diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-03-15 23:54:35 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-04-19 21:03:24 -0400 |
commit | 9d07bc841c9779b4d7902e417f4e509996ce805d (patch) | |
tree | 7a381096d3da7497aac58c4ec18c74299ee47fb4 /arch/powerpc/kernel/prom.c | |
parent | ad0693ee722b93b63a89c845e99513f242e43aa6 (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/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index e74fa12afc82..c391dc4c8bad 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -268,13 +268,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
268 | const char *uname, int depth, | 268 | const char *uname, int depth, |
269 | void *data) | 269 | void *data) |
270 | { | 270 | { |
271 | static int logical_cpuid = 0; | ||
272 | char *type = of_get_flat_dt_prop(node, "device_type", NULL); | 271 | char *type = of_get_flat_dt_prop(node, "device_type", NULL); |
273 | const u32 *prop; | 272 | const u32 *prop; |
274 | const u32 *intserv; | 273 | const u32 *intserv; |
275 | int i, nthreads; | 274 | int i, nthreads; |
276 | unsigned long len; | 275 | unsigned long len; |
277 | int found = 0; | 276 | int found = -1; |
278 | 277 | ||
279 | /* We are scanning "cpu" nodes only */ | 278 | /* We are scanning "cpu" nodes only */ |
280 | if (type == NULL || strcmp(type, "cpu") != 0) | 279 | if (type == NULL || strcmp(type, "cpu") != 0) |
@@ -299,11 +298,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
299 | * booted proc. | 298 | * booted proc. |
300 | */ | 299 | */ |
301 | if (initial_boot_params && initial_boot_params->version >= 2) { | 300 | if (initial_boot_params && initial_boot_params->version >= 2) { |
302 | if (intserv[i] == | 301 | if (intserv[i] == initial_boot_params->boot_cpuid_phys) |
303 | initial_boot_params->boot_cpuid_phys) { | 302 | found = boot_cpu_count; |
304 | found = 1; | ||
305 | break; | ||
306 | } | ||
307 | } else { | 303 | } else { |
308 | /* | 304 | /* |
309 | * Check if it's the boot-cpu, set it's hw index now, | 305 | * Check if it's the boot-cpu, set it's hw index now, |
@@ -311,23 +307,20 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
311 | * off secondary threads. | 307 | * off secondary threads. |
312 | */ | 308 | */ |
313 | if (of_get_flat_dt_prop(node, | 309 | if (of_get_flat_dt_prop(node, |
314 | "linux,boot-cpu", NULL) != NULL) { | 310 | "linux,boot-cpu", NULL) != NULL) |
315 | found = 1; | 311 | found = boot_cpu_count; |
316 | break; | ||
317 | } | ||
318 | } | 312 | } |
319 | |||
320 | #ifdef CONFIG_SMP | 313 | #ifdef CONFIG_SMP |
321 | /* logical cpu id is always 0 on UP kernels */ | 314 | /* logical cpu id is always 0 on UP kernels */ |
322 | logical_cpuid++; | 315 | boot_cpu_count++; |
323 | #endif | 316 | #endif |
324 | } | 317 | } |
325 | 318 | ||
326 | if (found) { | 319 | if (found >= 0) { |
327 | DBG("boot cpu: logical %d physical %d\n", logical_cpuid, | 320 | DBG("boot cpu: logical %d physical %d\n", found, |
328 | intserv[i]); | 321 | intserv[i]); |
329 | boot_cpuid = logical_cpuid; | 322 | boot_cpuid = found; |
330 | set_hard_smp_processor_id(boot_cpuid, intserv[i]); | 323 | set_hard_smp_processor_id(found, intserv[i]); |
331 | 324 | ||
332 | /* | 325 | /* |
333 | * PAPR defines "logical" PVR values for cpus that | 326 | * PAPR defines "logical" PVR values for cpus that |