diff options
author | Xunlei Pang <pang.xunlei@linaro.org> | 2015-04-01 23:34:38 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-04-03 02:18:34 -0400 |
commit | 0fa88cb4b82b5cf7429bc1cef9db006ca035754e (patch) | |
tree | b3800f619ee137e6914e56bf803968642bd389af /drivers/rtc | |
parent | 264bb3f79f2a465477cdcd2f0554e21aedc443a3 (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 'drivers/rtc')
-rw-r--r-- | drivers/rtc/class.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index d40760aa4553..c29ba7e14304 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
@@ -55,7 +55,7 @@ static int rtc_suspend(struct device *dev) | |||
55 | struct timespec64 delta, delta_delta; | 55 | struct timespec64 delta, delta_delta; |
56 | int err; | 56 | int err; |
57 | 57 | ||
58 | if (has_persistent_clock()) | 58 | if (timekeeping_rtc_skipsuspend()) |
59 | return 0; | 59 | return 0; |
60 | 60 | ||
61 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) | 61 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) |
@@ -102,7 +102,7 @@ static int rtc_resume(struct device *dev) | |||
102 | struct timespec64 sleep_time; | 102 | struct timespec64 sleep_time; |
103 | int err; | 103 | int err; |
104 | 104 | ||
105 | if (has_persistent_clock()) | 105 | if (timekeeping_rtc_skipresume()) |
106 | return 0; | 106 | return 0; |
107 | 107 | ||
108 | rtc_hctosys_ret = -ENODEV; | 108 | rtc_hctosys_ret = -ENODEV; |