aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/bugs.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-10-16 17:20:58 +0900
committerPaul Mundt <lethal@linux-sh.org>2009-10-16 17:20:58 +0900
commitf533c3d340536198a4889a42a68d6c0d79a504e7 (patch)
tree1e45cd7687b4b0eb9eca5339d92c79abae5db0b5 /arch/sh/include/asm/bugs.h
parentsh: Force boot CPU in to light sleep mode for SH-X3 SMP. (diff)
downloadlinux-dev-f533c3d340536198a4889a42a68d6c0d79a504e7.tar.xz
linux-dev-f533c3d340536198a4889a42a68d6c0d79a504e7.zip
sh: Idle loop chainsawing for SMP-based light sleep.
This does a bit of chainsawing of the idle loop code to get light sleep working on SMP. Previously this was forcing secondary CPUs in to sleep mode with them not coming back if they didn't have their own local timers. Given that we use clockevents broadcasting by default, the CPU managing the clockevents can't have IRQs disabled before entering its sleep state. This unfortunately leaves us with the age-old need_resched() race in between local_irq_enable() and cpu_sleep(), but at present this is unavoidable. After some more experimentation it may be possible to layer on SR.BL bit manipulation over top of this scheme to inhibit the race condition, but given the current potential for missing wakeups, this is left as a future exercise. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/bugs.h')
-rw-r--r--arch/sh/include/asm/bugs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sh/include/asm/bugs.h b/arch/sh/include/asm/bugs.h
index 46260fcbdf4b..02a19a1c033a 100644
--- a/arch/sh/include/asm/bugs.h
+++ b/arch/sh/include/asm/bugs.h
@@ -14,11 +14,15 @@
#include <asm/processor.h>
+extern void select_idle_routine(void);
+
static void __init check_bugs(void)
{
extern unsigned long loops_per_jiffy;
char *p = &init_utsname()->machine[2]; /* "sh" */
+ select_idle_routine();
+
current_cpu_data.loops_per_jiffy = loops_per_jiffy;
switch (current_cpu_data.family) {