diff options
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index c1d62bf11f29..b17630ad4ac7 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -352,12 +352,13 @@ void __init check_for_initrd(void) | |||
352 | * must be called before using this. | 352 | * must be called before using this. |
353 | * | 353 | * |
354 | * While we're here, we may as well set the "physical" cpu ids in the paca. | 354 | * While we're here, we may as well set the "physical" cpu ids in the paca. |
355 | * | ||
356 | * NOTE: This must match the parsing done in early_init_dt_scan_cpus. | ||
355 | */ | 357 | */ |
356 | void __init smp_setup_cpu_maps(void) | 358 | void __init smp_setup_cpu_maps(void) |
357 | { | 359 | { |
358 | struct device_node *dn = NULL; | 360 | struct device_node *dn = NULL; |
359 | int cpu = 0; | 361 | int cpu = 0; |
360 | int swap_cpuid = 0; | ||
361 | 362 | ||
362 | while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { | 363 | while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { |
363 | int *intserv; | 364 | int *intserv; |
@@ -376,24 +377,11 @@ void __init smp_setup_cpu_maps(void) | |||
376 | for (j = 0; j < nthreads && cpu < NR_CPUS; j++) { | 377 | for (j = 0; j < nthreads && cpu < NR_CPUS; j++) { |
377 | cpu_set(cpu, cpu_present_map); | 378 | cpu_set(cpu, cpu_present_map); |
378 | set_hard_smp_processor_id(cpu, intserv[j]); | 379 | set_hard_smp_processor_id(cpu, intserv[j]); |
379 | |||
380 | if (intserv[j] == boot_cpuid_phys) | ||
381 | swap_cpuid = cpu; | ||
382 | cpu_set(cpu, cpu_possible_map); | 380 | cpu_set(cpu, cpu_possible_map); |
383 | cpu++; | 381 | cpu++; |
384 | } | 382 | } |
385 | } | 383 | } |
386 | 384 | ||
387 | /* Swap CPU id 0 with boot_cpuid_phys, so we can always assume that | ||
388 | * boot cpu is logical 0. | ||
389 | */ | ||
390 | if (boot_cpuid_phys != get_hard_smp_processor_id(0)) { | ||
391 | u32 tmp; | ||
392 | tmp = get_hard_smp_processor_id(0); | ||
393 | set_hard_smp_processor_id(0, boot_cpuid_phys); | ||
394 | set_hard_smp_processor_id(swap_cpuid, tmp); | ||
395 | } | ||
396 | |||
397 | #ifdef CONFIG_PPC64 | 385 | #ifdef CONFIG_PPC64 |
398 | /* | 386 | /* |
399 | * On pSeries LPAR, we need to know how many cpus | 387 | * On pSeries LPAR, we need to know how many cpus |