Commit 7ac87abb8166b99584149fcfb2efef5773a078e9
Committed by
Benjamin Herrenschmidt
1 parent
32d206eb56
Exists in
master
and in
6 other branches
powerpc: Fix early boot accounting of CPUs
smp_release_cpus() waits for all cpus (including the bootcpu) due to an off-by-one count on boot_cpu_count (which is all CPUs). This patch replaces that with spinning_secondaries (which is all secondary CPUs). Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Showing 5 changed files with 13 additions and 6 deletions Side-by-side Diff
arch/powerpc/include/asm/smp.h
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/prom.c
... | ... | @@ -69,6 +69,7 @@ |
69 | 69 | u64 ppc64_rma_size; |
70 | 70 | #endif |
71 | 71 | static phys_addr_t first_memblock_size; |
72 | +static int __initdata boot_cpu_count; | |
72 | 73 | |
73 | 74 | static int __init early_parse_mem(char *p) |
74 | 75 | { |
... | ... | @@ -747,6 +748,13 @@ |
747 | 748 | * (altivec support, boot CPU ID, ...) |
748 | 749 | */ |
749 | 750 | of_scan_flat_dt(early_init_dt_scan_cpus, NULL); |
751 | + | |
752 | +#if defined(CONFIG_SMP) && defined(CONFIG_PPC64) | |
753 | + /* We'll later wait for secondaries to check in; there are | |
754 | + * NCPUS-1 non-boot CPUs :-) | |
755 | + */ | |
756 | + spinning_secondaries = boot_cpu_count - 1; | |
757 | +#endif | |
750 | 758 | |
751 | 759 | DBG(" <- early_init_devtree()\n"); |
752 | 760 | } |
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/setup_64.c
... | ... | @@ -73,7 +73,7 @@ |
73 | 73 | #endif |
74 | 74 | |
75 | 75 | int boot_cpuid = 0; |
76 | -int __initdata boot_cpu_count; | |
76 | +int __initdata spinning_secondaries; | |
77 | 77 | u64 ppc64_pft_size; |
78 | 78 | |
79 | 79 | /* Pick defaults since we might want to patch instructions |
80 | 80 | |
... | ... | @@ -253,11 +253,11 @@ |
253 | 253 | for (i = 0; i < 100000; i++) { |
254 | 254 | mb(); |
255 | 255 | HMT_low(); |
256 | - if (boot_cpu_count == 0) | |
256 | + if (spinning_secondaries == 0) | |
257 | 257 | break; |
258 | 258 | udelay(1); |
259 | 259 | } |
260 | - DBG("boot_cpu_count = %d\n", boot_cpu_count); | |
260 | + DBG("spinning_secondaries = %d\n", spinning_secondaries); | |
261 | 261 | |
262 | 262 | DBG(" <- smp_release_cpus()\n"); |
263 | 263 | } |