diff options
-rw-r--r-- | arch/arm/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/system.h | 2 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 19 |
3 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7562f884f2c5..94360e7a7abc 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -145,6 +145,9 @@ config ARCH_HAS_CPUFREQ | |||
145 | and that the relevant menu configurations are displayed for | 145 | and that the relevant menu configurations are displayed for |
146 | it. | 146 | it. |
147 | 147 | ||
148 | config ARCH_HAS_CPU_IDLE_WAIT | ||
149 | def_bool y | ||
150 | |||
148 | config GENERIC_HWEIGHT | 151 | config GENERIC_HWEIGHT |
149 | bool | 152 | bool |
150 | default y | 153 | default y |
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 8ba1ccf82a02..48e360c74327 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
@@ -325,6 +325,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size | |||
325 | extern void disable_hlt(void); | 325 | extern void disable_hlt(void); |
326 | extern void enable_hlt(void); | 326 | extern void enable_hlt(void); |
327 | 327 | ||
328 | void cpu_idle_wait(void); | ||
329 | |||
328 | #include <asm-generic/cmpxchg-local.h> | 330 | #include <asm-generic/cmpxchg-local.h> |
329 | 331 | ||
330 | #if __LINUX_ARM_ARCH__ < 6 | 332 | #if __LINUX_ARM_ARCH__ < 6 |
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 |