aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/timekeeping.h
diff options
context:
space:
mode:
authorXunlei Pang <pang.xunlei@linaro.org>2015-04-01 23:34:38 -0400
committerIngo Molnar <mingo@kernel.org>2015-04-03 02:18:34 -0400
commit0fa88cb4b82b5cf7429bc1cef9db006ca035754e (patch)
treeb3800f619ee137e6914e56bf803968642bd389af /include/linux/timekeeping.h
parent264bb3f79f2a465477cdcd2f0554e21aedc443a3 (diff)
time, drivers/rtc: Don't bother with rtc_resume() for the nonstop clocksource
If a system does not provide a persistent_clock(), the time will be updated on resume by rtc_resume(). With the addition of the non-stop clocksources for suspend timing, those systems set the time on resume in timekeeping_resume(), but may not provide a valid persistent_clock(). This results in the rtc_resume() logic thinking no one has set the time and it then will over-write the suspend time again, which is not necessary and only increases clock error. So, fix this for rtc_resume(). This patch also improves the name of persistent_clock_exist to make it more grammatical. Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1427945681-29972-19-git-send-email-john.stultz@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/timekeeping.h')
-rw-r--r--include/linux/timekeeping.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 7a2369d5b3f4..99176af216af 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -248,6 +248,9 @@ static inline void timekeeping_clocktai(struct timespec *ts)
248/* 248/*
249 * RTC specific 249 * RTC specific
250 */ 250 */
251extern bool timekeeping_rtc_skipsuspend(void);
252extern bool timekeeping_rtc_skipresume(void);
253
251extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); 254extern void timekeeping_inject_sleeptime64(struct timespec64 *delta);
252 255
253/* 256/*
@@ -259,14 +262,8 @@ extern void getnstime_raw_and_real(struct timespec *ts_raw,
259/* 262/*
260 * Persistent clock related interfaces 263 * Persistent clock related interfaces
261 */ 264 */
262extern bool persistent_clock_exist;
263extern int persistent_clock_is_local; 265extern int persistent_clock_is_local;
264 266
265static inline bool has_persistent_clock(void)
266{
267 return persistent_clock_exist;
268}
269
270extern void read_persistent_clock(struct timespec *ts); 267extern void read_persistent_clock(struct timespec *ts);
271extern void read_persistent_clock64(struct timespec64 *ts); 268extern void read_persistent_clock64(struct timespec64 *ts);
272extern void read_boot_clock(struct timespec *ts); 269extern void read_boot_clock(struct timespec *ts);