diff options
author | Prarit Bhargava <prarit@redhat.com> | 2013-02-08 17:59:53 -0500 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2013-02-08 18:07:05 -0500 |
commit | 84e345e4e209cbe796c88fa2ad1732d7121ec100 (patch) | |
tree | f73f35d0e72a6c6f3e4b3ef430608aca3a5e8d54 /include/linux/time.h | |
parent | 6f16eebe1ff82176339a0439c98ebec9768b0ee2 (diff) |
time, Fix setting of hardware clock in NTP code
At init time, if the system time is "warped" forward in warp_clock()
it will differ from the hardware clock by sys_tz.tz_minuteswest. This time
difference is not taken into account when ntp updates the hardware clock,
and this causes the system time to jump forward by this offset every reboot.
The kernel must take this offset into account when writing the system time
to the hardware clock in the ntp code. This patch adds
persistent_clock_is_local which indicates that an offset has been applied
in warp_clock() and accounts for the "warp" before writing the hardware
clock.
x86 does not have this problem as rtc writes are software limited to a
+/-15 minute window relative to the current rtc time. Other arches, such
as powerpc, however do a full synchronization of the system time to the
rtc and will see this problem.
[v2]: generated against tip/timers/core
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/time.h')
-rw-r--r-- | include/linux/time.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h index 476e1d7b2c37..a3ab6a814a9c 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -128,6 +128,7 @@ static inline bool has_persistent_clock(void) | |||
128 | 128 | ||
129 | extern void read_persistent_clock(struct timespec *ts); | 129 | extern void read_persistent_clock(struct timespec *ts); |
130 | extern void read_boot_clock(struct timespec *ts); | 130 | extern void read_boot_clock(struct timespec *ts); |
131 | extern int persistent_clock_is_local; | ||
131 | extern int update_persistent_clock(struct timespec now); | 132 | extern int update_persistent_clock(struct timespec now); |
132 | void timekeeping_init(void); | 133 | void timekeeping_init(void); |
133 | extern int timekeeping_suspended; | 134 | extern int timekeeping_suspended; |