aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pmc-sierra
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-02-23 07:23:27 -0500
committerRalf Baechle <ralf@linux-mips.org>2006-02-27 12:30:36 -0500
commit9b6695a8adfe0916e81ddd810a5b9db3eb8b0e46 (patch)
tree62ba9475530c88ccf2149cd58eabd97ebe096aca /arch/mips/pmc-sierra
parent3e6cb2d38a9c9758170813497a860c64543643d5 (diff)
[MIPS] SMP: Fix initialization order bug.
A recent change requires cpu_possible_map to be initialized before smp_sched_init() but most MIPS platforms were initializing their processors in the prom_prepare_cpus callback of smp_prepare_cpus. The simple fix of calling prom_prepare_cpus from one of the earlier SMP initialization hooks doesn't work well either since IPIs may require init_IRQ() to have completed, so bit the bullet and split prom_prepare_cpus into two initialization functions, plat_smp_setup which is called early from setup_arch and plat_prepare_cpus called where prom_prepare_cpus used to be called. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/pmc-sierra')
-rw-r--r--arch/mips/pmc-sierra/yosemite/smp.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c
index 7f8fda962190..c197311e15d3 100644
--- a/arch/mips/pmc-sierra/yosemite/smp.c
+++ b/arch/mips/pmc-sierra/yosemite/smp.c
@@ -50,37 +50,25 @@ void __init prom_grab_secondary(void)
50 * We don't want to start the secondary CPU yet nor do we have a nice probing 50 * We don't want to start the secondary CPU yet nor do we have a nice probing
51 * feature in PMON so we just assume presence of the secondary core. 51 * feature in PMON so we just assume presence of the secondary core.
52 */ 52 */
53static char maxcpus_string[] __initdata = 53void __init plat_smp_setup(void)
54 KERN_WARNING "max_cpus set to 0; using 1 instead\n";
55
56void __init prom_prepare_cpus(unsigned int max_cpus)
57{ 54{
58 int enabled = 0, i; 55 int i;
59
60 if (max_cpus == 0) {
61 printk(maxcpus_string);
62 max_cpus = 1;
63 }
64 56
65 cpus_clear(phys_cpu_present_map); 57 cpus_clear(phys_cpu_present_map);
66 58
67 for (i = 0; i < 2; i++) { 59 for (i = 0; i < 2; i++) {
68 if (i == max_cpus)
69 break;
70
71 /*
72 * The boot CPU
73 */
74 cpu_set(i, phys_cpu_present_map); 60 cpu_set(i, phys_cpu_present_map);
75 __cpu_number_map[i] = i; 61 __cpu_number_map[i] = i;
76 __cpu_logical_map[i] = i; 62 __cpu_logical_map[i] = i;
77 enabled++;
78 } 63 }
64}
79 65
66void __init plat_prepare_cpus(unsigned int max_cpus)
67{
80 /* 68 /*
81 * Be paranoid. Enable the IPI only if we're really about to go SMP. 69 * Be paranoid. Enable the IPI only if we're really about to go SMP.
82 */ 70 */
83 if (enabled > 1) 71 if (cpus_weight(cpu_possible_map))
84 set_c0_status(STATUSF_IP5); 72 set_c0_status(STATUSF_IP5);
85} 73}
86 74