cpuidle: Export the next timer expiration for CPUs
[sfrench/cifs-2.6.git] / kernel / time / tick-sched.c
index 6fa52cd6df0be2f53c8e79bf0e8cf16bcf0310f0..8d18e03124ff4ce2d629b6f81951626ae1e76d86 100644 (file)
@@ -1022,6 +1022,18 @@ bool tick_nohz_idle_got_tick(void)
        return false;
 }
 
+/**
+ * tick_nohz_get_next_hrtimer - return the next expiration time for the hrtimer
+ * or the tick, whatever that expires first. Note that, if the tick has been
+ * stopped, it returns the next hrtimer.
+ *
+ * Called from power state control code with interrupts disabled
+ */
+ktime_t tick_nohz_get_next_hrtimer(void)
+{
+       return __this_cpu_read(tick_cpu_device.evtdev)->next_event;
+}
+
 /**
  * tick_nohz_get_sleep_length - return the expected length of the current sleep
  * @delta_next: duration until the next event if the tick cannot be stopped