History

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

Prarit Bhargava committed 13 years ago

Commit 84e345e1 parent 6f16eeb3 files · +15 −2Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/time.h+1−0
@@ -128,6 +128,7 @@ static inline bool has_persistent_clock(void) · 127 unmodified lines
128128
129129 extern void read_persistent_clock(struct timespec *ts);
130130 extern void read_boot_clock(struct timespec *ts);
131+extern int persistent_clock_is_local;
131132 extern int update_persistent_clock(struct timespec now);
132133 void timekeeping_init(void);
133134 extern int timekeeping_suspended;