aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/processor.h4
-rw-r--r--arch/sh/kernel/smp.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 26b3f026eec..0a58cb25a65 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -85,6 +85,10 @@ struct sh_cpuinfo {
85 struct tlb_info itlb; 85 struct tlb_info itlb;
86 struct tlb_info dtlb; 86 struct tlb_info dtlb;
87 87
88#ifdef CONFIG_SMP
89 struct task_struct *idle;
90#endif
91
88 unsigned long flags; 92 unsigned long flags;
89} __attribute__ ((aligned(L1_CACHE_BYTES))); 93} __attribute__ ((aligned(L1_CACHE_BYTES)));
90 94
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 3711a76a18e..21e7f8a9f3e 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -125,10 +125,15 @@ int __cpuinit __cpu_up(unsigned int cpu)
125 struct task_struct *tsk; 125 struct task_struct *tsk;
126 unsigned long timeout; 126 unsigned long timeout;
127 127
128 tsk = fork_idle(cpu); 128 tsk = cpu_data[cpu].idle;
129 if (IS_ERR(tsk)) { 129 if (!tsk) {
130 printk(KERN_ERR "Failed forking idle task for cpu %d\n", cpu); 130 tsk = fork_idle(cpu);
131 return PTR_ERR(tsk); 131 if (IS_ERR(tsk)) {
132 pr_err("Failed forking idle task for cpu %d\n", cpu);
133 return PTR_ERR(tsk);
134 }
135
136 cpu_data[cpu].idle = tsk;
132 } 137 }
133 138
134 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; 139 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;