diff options
Diffstat (limited to 'drivers/cpuidle/driver.c')
-rw-r--r-- | drivers/cpuidle/driver.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c index 2697e87d5b34..5db147859b90 100644 --- a/drivers/cpuidle/driver.c +++ b/drivers/cpuidle/driver.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/cpuidle.h> | 14 | #include <linux/cpuidle.h> |
15 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
16 | #include <linux/clockchips.h> | 16 | #include <linux/tick.h> |
17 | 17 | ||
18 | #include "cpuidle.h" | 18 | #include "cpuidle.h" |
19 | 19 | ||
@@ -130,21 +130,20 @@ static inline void __cpuidle_unset_driver(struct cpuidle_driver *drv) | |||
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer | 133 | * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer on a cpu |
134 | * @arg: a void pointer used to match the SMP cross call API | 134 | * @arg: a void pointer used to match the SMP cross call API |
135 | * | 135 | * |
136 | * @arg is used as a value of type 'long' with one of the two values: | 136 | * If @arg is NULL broadcast is disabled otherwise enabled |
137 | * - CLOCK_EVT_NOTIFY_BROADCAST_ON | ||
138 | * - CLOCK_EVT_NOTIFY_BROADCAST_OFF | ||
139 | * | 137 | * |
140 | * Set the broadcast timer notification for the current CPU. This function | 138 | * This function is executed per CPU by an SMP cross call. It's not |
141 | * is executed per CPU by an SMP cross call. It not supposed to be called | 139 | * supposed to be called directly. |
142 | * directly. | ||
143 | */ | 140 | */ |
144 | static void cpuidle_setup_broadcast_timer(void *arg) | 141 | static void cpuidle_setup_broadcast_timer(void *arg) |
145 | { | 142 | { |
146 | int cpu = smp_processor_id(); | 143 | if (arg) |
147 | clockevents_notify((long)(arg), &cpu); | 144 | tick_broadcast_enable(); |
145 | else | ||
146 | tick_broadcast_disable(); | ||
148 | } | 147 | } |
149 | 148 | ||
150 | /** | 149 | /** |
@@ -239,7 +238,7 @@ static int __cpuidle_register_driver(struct cpuidle_driver *drv) | |||
239 | 238 | ||
240 | if (drv->bctimer) | 239 | if (drv->bctimer) |
241 | on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer, | 240 | on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer, |
242 | (void *)CLOCK_EVT_NOTIFY_BROADCAST_ON, 1); | 241 | (void *)1, 1); |
243 | 242 | ||
244 | poll_idle_init(drv); | 243 | poll_idle_init(drv); |
245 | 244 | ||
@@ -263,7 +262,7 @@ static void __cpuidle_unregister_driver(struct cpuidle_driver *drv) | |||
263 | if (drv->bctimer) { | 262 | if (drv->bctimer) { |
264 | drv->bctimer = 0; | 263 | drv->bctimer = 0; |
265 | on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer, | 264 | on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer, |
266 | (void *)CLOCK_EVT_NOTIFY_BROADCAST_OFF, 1); | 265 | NULL, 1); |
267 | } | 266 | } |
268 | 267 | ||
269 | __cpuidle_unset_driver(drv); | 268 | __cpuidle_unset_driver(drv); |