aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/smp.c')
-rw-r--r--arch/sh/kernel/smp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 3711a76a18e0..21e7f8a9f3e4 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -125,10 +125,15 @@ int __cpuinit __cpu_up(unsigned int cpu)
struct task_struct *tsk;
unsigned long timeout;
- tsk = fork_idle(cpu);
- if (IS_ERR(tsk)) {
- printk(KERN_ERR "Failed forking idle task for cpu %d\n", cpu);
- return PTR_ERR(tsk);
+ tsk = cpu_data[cpu].idle;
+ if (!tsk) {
+ tsk = fork_idle(cpu);
+ if (IS_ERR(tsk)) {
+ pr_err("Failed forking idle task for cpu %d\n", cpu);
+ return PTR_ERR(tsk);
+ }
+
+ cpu_data[cpu].idle = tsk;
}
per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;