diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-04-26 05:59:47 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-04-26 05:59:47 -0400 |
commit | 8db2bc4559639680a94d4492ae4b7ce71298a74f (patch) | |
tree | 568526fbfb22eea6e4a94748425fe1ccfd5f0a29 /arch/sh/kernel/smp.c | |
parent | 1cfa1e8f2c824b131612c9a70b48433998237331 (diff) |
sh: cache secondary CPUs idle loop.
This provides a cache of the secondary CPUs idle loop for the cases where
hotplug simply enters a low power state instead of resetting or powering
off the core.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/smp.c')
-rw-r--r-- | arch/sh/kernel/smp.c | 13 |
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) | |||
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; |