Commit 8db2bc45 authored by Paul Mundt's avatar Paul Mundt

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: default avatarPaul Mundt <lethal@linux-sh.org>
parent 1cfa1e8f
...@@ -85,6 +85,10 @@ struct sh_cpuinfo { ...@@ -85,6 +85,10 @@ struct sh_cpuinfo {
struct tlb_info itlb; struct tlb_info itlb;
struct tlb_info dtlb; struct tlb_info dtlb;
#ifdef CONFIG_SMP
struct task_struct *idle;
#endif
unsigned long flags; unsigned long flags;
} __attribute__ ((aligned(L1_CACHE_BYTES))); } __attribute__ ((aligned(L1_CACHE_BYTES)));
......
...@@ -125,10 +125,15 @@ int __cpuinit __cpu_up(unsigned int cpu) ...@@ -125,10 +125,15 @@ int __cpuinit __cpu_up(unsigned int cpu)
struct task_struct *tsk; struct task_struct *tsk;
unsigned long timeout; unsigned long timeout;
tsk = fork_idle(cpu); tsk = cpu_data[cpu].idle;
if (IS_ERR(tsk)) { if (!tsk) {
printk(KERN_ERR "Failed forking idle task for cpu %d\n", cpu); tsk = fork_idle(cpu);
return PTR_ERR(tsk); 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; per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment