Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'timers_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fixes from Borislav Petkov:

- Fix an integer overflow in the NTP RTC synchronization which led to
the latter happening every 2 seconds instead of the intended every 11
minutes.

- Get rid of now unused get_seconds().

* tag 'timers_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
ntp: Fix RTC synchronization on 32-bit platforms
timekeeping: Remove unused get_seconds()

+3 -19
-1
include/linux/ktime.h
··· 230 230 } 231 231 232 232 # include <linux/timekeeping.h> 233 - # include <linux/timekeeping32.h> 234 233 235 234 #endif
-14
include/linux/timekeeping32.h
··· 1 - #ifndef _LINUX_TIMEKEEPING32_H 2 - #define _LINUX_TIMEKEEPING32_H 3 - /* 4 - * These interfaces are all based on the old timespec type 5 - * and should get replaced with the timespec64 based versions 6 - * over time so we can remove the file here. 7 - */ 8 - 9 - static inline unsigned long get_seconds(void) 10 - { 11 - return ktime_get_real_seconds(); 12 - } 13 - 14 - #endif
+2 -2
kernel/time/ntp.c
··· 498 498 static void sync_hw_clock(struct work_struct *work); 499 499 static DECLARE_WORK(sync_work, sync_hw_clock); 500 500 static struct hrtimer sync_hrtimer; 501 - #define SYNC_PERIOD_NS (11UL * 60 * NSEC_PER_SEC) 501 + #define SYNC_PERIOD_NS (11ULL * 60 * NSEC_PER_SEC) 502 502 503 503 static enum hrtimer_restart sync_timer_callback(struct hrtimer *timer) 504 504 { ··· 512 512 ktime_t exp = ktime_set(ktime_get_real_seconds(), 0); 513 513 514 514 if (retry) 515 - exp = ktime_add_ns(exp, 2 * NSEC_PER_SEC - offset_nsec); 515 + exp = ktime_add_ns(exp, 2ULL * NSEC_PER_SEC - offset_nsec); 516 516 else 517 517 exp = ktime_add_ns(exp, SYNC_PERIOD_NS - offset_nsec); 518 518
+1 -2
kernel/time/timekeeping.c
··· 991 991 /** 992 992 * ktime_get_real_seconds - Get the seconds portion of CLOCK_REALTIME 993 993 * 994 - * Returns the wall clock seconds since 1970. This replaces the 995 - * get_seconds() interface which is not y2038 safe on 32bit systems. 994 + * Returns the wall clock seconds since 1970. 996 995 * 997 996 * For 64bit systems the fast access to tk->xtime_sec is preserved. On 998 997 * 32bit systems the access must be protected with the sequence