diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2010-10-01 17:13:47 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-10-08 05:02:24 -0400 |
commit | c7b0aff44a0740eedd31b759fd08d9e25672fa76 (patch) | |
tree | 02991fc91b0733c6b0f2ce8de2d0741b5ff43ef6 /arch/arm/kernel | |
parent | 7511db9d25080d53e5427bf4b8849278c07019bc (diff) |
ARM: 6428/1: add cpu_idle_wait() to support CPUidle on SMP systems.
In order for CPUidle to work on SMP systems, an implementation of
cpu_idle_wait() is needed.
This patch duplicates the x86 implementation of cpu_idle_wait() for
ARM.
Tested-by: Colin Cross <ccross@android.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/process.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 401e38be1f78..23def52d2d24 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -135,6 +135,25 @@ EXPORT_SYMBOL(pm_power_off); | |||
135 | void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart; | 135 | void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart; |
136 | EXPORT_SYMBOL_GPL(arm_pm_restart); | 136 | EXPORT_SYMBOL_GPL(arm_pm_restart); |
137 | 137 | ||
138 | static void do_nothing(void *unused) | ||
139 | { | ||
140 | } | ||
141 | |||
142 | /* | ||
143 | * cpu_idle_wait - Used to ensure that all the CPUs discard old value of | ||
144 | * pm_idle and update to new pm_idle value. Required while changing pm_idle | ||
145 | * handler on SMP systems. | ||
146 | * | ||
147 | * Caller must have changed pm_idle to the new value before the call. Old | ||
148 | * pm_idle value will not be used by any CPU after the return of this function. | ||
149 | */ | ||
150 | void cpu_idle_wait(void) | ||
151 | { | ||
152 | smp_mb(); | ||
153 | /* kick all the CPUs so that they exit out of pm_idle */ | ||
154 | smp_call_function(do_nothing, NULL, 1); | ||
155 | } | ||
156 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | ||
138 | 157 | ||
139 | /* | 158 | /* |
140 | * This is our default idle handler. We need to disable | 159 | * This is our default idle handler. We need to disable |