summaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-04-26 18:59:47 +0900
committerPaul Mundt <lethal@linux-sh.org>2010-04-26 18:59:47 +0900
commit8db2bc4559639680a94d4492ae4b7ce71298a74f (patch)
tree568526fbfb22eea6e4a94748425fe1ccfd5f0a29 /arch/sh
parent1cfa1e8f2c824b131612c9a70b48433998237331 (diff)
downloadlinux-8db2bc4559639680a94d4492ae4b7ce71298a74f.tar.bz2
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')
-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 26b3f026eec9..0a58cb25a658 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -85,6 +85,10 @@ struct sh_cpuinfo {
struct tlb_info itlb;
struct tlb_info dtlb;
+#ifdef CONFIG_SMP
+ struct task_struct *idle;
+#endif
+
unsigned long flags;
} __attribute__ ((aligned(L1_CACHE_BYTES)));
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;