diff options
Diffstat (limited to 'arch/mips/kernel/smp.c')
-rw-r--r-- | arch/mips/kernel/smp.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index c937506a03aa..bc7d9b05e2f4 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/smp.h> | ||
25 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
26 | #include <linux/threads.h> | 27 | #include <linux/threads.h> |
27 | #include <linux/module.h> | 28 | #include <linux/module.h> |
@@ -44,7 +45,7 @@ | |||
44 | #include <asm/mipsmtregs.h> | 45 | #include <asm/mipsmtregs.h> |
45 | #endif /* CONFIG_MIPS_MT_SMTC */ | 46 | #endif /* CONFIG_MIPS_MT_SMTC */ |
46 | 47 | ||
47 | static volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ | 48 | volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ |
48 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ | 49 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ |
49 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ | 50 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ |
50 | 51 | ||
@@ -200,6 +201,8 @@ void __devinit smp_prepare_boot_cpu(void) | |||
200 | * and keep control until "cpu_online(cpu)" is set. Note: cpu is | 201 | * and keep control until "cpu_online(cpu)" is set. Note: cpu is |
201 | * physical, not logical. | 202 | * physical, not logical. |
202 | */ | 203 | */ |
204 | static struct task_struct *cpu_idle_thread[NR_CPUS]; | ||
205 | |||
203 | int __cpuinit __cpu_up(unsigned int cpu) | 206 | int __cpuinit __cpu_up(unsigned int cpu) |
204 | { | 207 | { |
205 | struct task_struct *idle; | 208 | struct task_struct *idle; |
@@ -209,9 +212,16 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
209 | * The following code is purely to make sure | 212 | * The following code is purely to make sure |
210 | * Linux can schedule processes on this slave. | 213 | * Linux can schedule processes on this slave. |
211 | */ | 214 | */ |
212 | idle = fork_idle(cpu); | 215 | if (!cpu_idle_thread[cpu]) { |
213 | if (IS_ERR(idle)) | 216 | idle = fork_idle(cpu); |
214 | panic(KERN_ERR "Fork failed for CPU %d", cpu); | 217 | cpu_idle_thread[cpu] = idle; |
218 | |||
219 | if (IS_ERR(idle)) | ||
220 | panic(KERN_ERR "Fork failed for CPU %d", cpu); | ||
221 | } else { | ||
222 | idle = cpu_idle_thread[cpu]; | ||
223 | init_idle(idle, cpu); | ||
224 | } | ||
215 | 225 | ||
216 | mp_ops->boot_secondary(cpu, idle); | 226 | mp_ops->boot_secondary(cpu, idle); |
217 | 227 | ||