aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-10-10 00:32:13 -0400
committerLen Brown <len.brown@intel.com>2007-10-10 00:32:13 -0400
commitde85871a9a53c00cae4c3a70849b5eaad0eb38b2 (patch)
treee1f5ea71da333598db35a63a2c6faa1343037412 /kernel
parentPull bugzilla-8709 into release branch (diff)
parentACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle (diff)
downloadlinux-dev-de85871a9a53c00cae4c3a70849b5eaad0eb38b2.tar.xz
linux-dev-de85871a9a53c00cae4c3a70849b5eaad0eb38b2.zip
Pull cpuidle into test branch
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/tick-sched.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 8c3fef1db09c..637519af6151 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -153,6 +153,7 @@ void tick_nohz_stop_sched_tick(void)
unsigned long seq, last_jiffies, next_jiffies, delta_jiffies, flags;
struct tick_sched *ts;
ktime_t last_update, expires, now, delta;
+ struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
int cpu;
local_irq_save(flags);
@@ -302,11 +303,26 @@ void tick_nohz_stop_sched_tick(void)
out:
ts->next_jiffies = next_jiffies;
ts->last_jiffies = last_jiffies;
+ ts->sleep_length = ktime_sub(dev->next_event, now);
end:
local_irq_restore(flags);
}
/**
+ * tick_nohz_get_sleep_length - return the length of the current sleep
+ *
+ * Called from power state control code with interrupts disabled
+ */
+ktime_t tick_nohz_get_sleep_length(void)
+{
+ struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
+
+ return ts->sleep_length;
+}
+
+EXPORT_SYMBOL_GPL(tick_nohz_get_sleep_length);
+
+/**
* nohz_restart_sched_tick - restart the idle tick from the idle task
*
* Restart the idle tick when the CPU is woken up from idle