aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2013-03-21 08:21:31 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-03-31 19:10:27 -0400
commitb60e6a0eb0273132cbb60a9806abf5f47a4aee1c (patch)
tree85b53cc9faa960a653041e7d4eab8b93b9487891 /drivers/cpuidle
parent07961ac7c0ee8b546658717034fe692fd12eefa9 (diff)
cpuidle : handle clockevent notify from the cpuidle framework
When a cpu enters a deep idle state, the local timers are stopped and the time framework falls back to the timer device used as a broadcast timer. The different cpuidle drivers are calling clockevents_notify ENTER/EXIT when the idle state stops the local timer. Add a new flag CPUIDLE_FLAG_TIMER_STOP which can be set by the cpuidle drivers. If the flag is set, the cpuidle core code takes care of the notification on behalf of the driver to avoid pointless code duplication. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/cpuidle.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index eba69290e074..c50037029184 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -8,6 +8,7 @@
8 * This code is licenced under the GPL. 8 * This code is licenced under the GPL.
9 */ 9 */
10 10
11#include <linux/clockchips.h>
11#include <linux/kernel.h> 12#include <linux/kernel.h>
12#include <linux/mutex.h> 13#include <linux/mutex.h>
13#include <linux/sched.h> 14#include <linux/sched.h>
@@ -146,12 +147,20 @@ int cpuidle_idle_call(void)
146 147
147 trace_cpu_idle_rcuidle(next_state, dev->cpu); 148 trace_cpu_idle_rcuidle(next_state, dev->cpu);
148 149
150 if (drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP)
151 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
152 &dev->cpu);
153
149 if (cpuidle_state_is_coupled(dev, drv, next_state)) 154 if (cpuidle_state_is_coupled(dev, drv, next_state))
150 entered_state = cpuidle_enter_state_coupled(dev, drv, 155 entered_state = cpuidle_enter_state_coupled(dev, drv,
151 next_state); 156 next_state);
152 else 157 else
153 entered_state = cpuidle_enter_state(dev, drv, next_state); 158 entered_state = cpuidle_enter_state(dev, drv, next_state);
154 159
160 if (drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP)
161 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
162 &dev->cpu);
163
155 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); 164 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
156 165
157 /* give the governor an opportunity to reflect on the outcome */ 166 /* give the governor an opportunity to reflect on the outcome */