• Prarit Bhargava's avatar
    time, Fix setting of hardware clock in NTP code · 84e345e4
    Prarit Bhargava authored
    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: default avatarPrarit Bhargava <prarit@redhat.com>
    Cc: John Stultz <john.stultz@linaro.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
    84e345e4
ntp.c 23.9 KB