]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
sh: cache secondary CPUs idle loop.
authorPaul Mundt <lethal@linux-sh.org>
Mon, 26 Apr 2010 09:59:47 +0000 (18:59 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 26 Apr 2010 09:59:47 +0000 (18:59 +0900)
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>
arch/sh/include/asm/processor.h
arch/sh/kernel/smp.c

index 26b3f026eec951ebbab031de9df9280edafabb6c..0a58cb25a658ded43bb90ad831cbc6ecebed983d 100644 (file)
@@ -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)));
 
index 3711a76a18e077d84f48cf35b188e546e68d4f31..21e7f8a9f3e47ff5aeee349391d3b11681e0f816 100644 (file)
@@ -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;