aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/cpuidle.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index e81cfda295a5..bb4e827434ce 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -40,17 +40,6 @@ void disable_cpuidle(void)
40 off = 1; 40 off = 1;
41} 41}
42 42
43#if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT)
44static void cpuidle_kick_cpus(void)
45{
46 cpu_idle_wait();
47}
48#elif defined(CONFIG_SMP)
49# error "Arch needs cpu_idle_wait() equivalent here"
50#else /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT && !CONFIG_SMP */
51static void cpuidle_kick_cpus(void) {}
52#endif
53
54static int __cpuidle_register_device(struct cpuidle_device *dev); 43static int __cpuidle_register_device(struct cpuidle_device *dev);
55 44
56static inline int cpuidle_enter(struct cpuidle_device *dev, 45static inline int cpuidle_enter(struct cpuidle_device *dev,
@@ -152,15 +141,6 @@ int cpuidle_idle_call(void)
152 if (!dev || !dev->enabled) 141 if (!dev || !dev->enabled)
153 return -EBUSY; 142 return -EBUSY;
154 143
155#if 0
156 /* shows regressions, re-enable for 2.6.29 */
157 /*
158 * run any timers that can be run now, at this point
159 * before calculating the idle duration etc.
160 */
161 hrtimer_peek_ahead_timers();
162#endif
163
164 /* ask the governor for the next state */ 144 /* ask the governor for the next state */
165 next_state = cpuidle_curr_governor->select(drv, dev); 145 next_state = cpuidle_curr_governor->select(drv, dev);
166 if (need_resched()) { 146 if (need_resched()) {
@@ -206,7 +186,7 @@ void cpuidle_uninstall_idle_handler(void)
206{ 186{
207 if (enabled_devices) { 187 if (enabled_devices) {
208 initialized = 0; 188 initialized = 0;
209 cpuidle_kick_cpus(); 189 kick_all_cpus_sync();
210 } 190 }
211} 191}
212 192
@@ -314,6 +294,9 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
314 int ret, i; 294 int ret, i;
315 struct cpuidle_driver *drv = cpuidle_get_driver(); 295 struct cpuidle_driver *drv = cpuidle_get_driver();
316 296
297 if (!dev)
298 return -EINVAL;
299
317 if (dev->enabled) 300 if (dev->enabled)
318 return 0; 301 return 0;
319 if (!drv || !cpuidle_curr_governor) 302 if (!drv || !cpuidle_curr_governor)
@@ -398,8 +381,6 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
398 struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); 381 struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
399 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); 382 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
400 383
401 if (!dev)
402 return -EINVAL;
403 if (!try_module_get(cpuidle_driver->owner)) 384 if (!try_module_get(cpuidle_driver->owner))
404 return -EINVAL; 385 return -EINVAL;
405 386
@@ -436,6 +417,9 @@ int cpuidle_register_device(struct cpuidle_device *dev)
436{ 417{
437 int ret; 418 int ret;
438 419
420 if (!dev)
421 return -EINVAL;
422
439 mutex_lock(&cpuidle_lock); 423 mutex_lock(&cpuidle_lock);
440 424
441 if ((ret = __cpuidle_register_device(dev))) { 425 if ((ret = __cpuidle_register_device(dev))) {