···9999static int pps_valid; /* signal watchdog counter */100100static long pps_tf[3]; /* phase median filter */101101static long pps_jitter; /* current jitter (ns) */102102-static struct timespec pps_fbase; /* beginning of the last freq interval */102102+static struct timespec64 pps_fbase; /* beginning of the last freq interval */103103static int pps_shift; /* current interval duration (s) (shift) */104104static int pps_intcnt; /* interval counter */105105static s64 pps_freq; /* frequency offset (scaled ns/s) */···509509static void sync_cmos_clock(struct work_struct *work)510510{511511 struct timespec64 now;512512- struct timespec next;512512+ struct timespec64 next;513513 int fail = 1;514514515515 /*···559559 next.tv_nsec -= NSEC_PER_SEC;560560 }561561 queue_delayed_work(system_power_efficient_wq,562562- &sync_cmos_work, timespec_to_jiffies(&next));562562+ &sync_cmos_work, timespec64_to_jiffies(&next));563563}564564565565void ntp_notify_cmos_timer(void)···773773 * pps_normtime.nsec has a range of ( -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ]774774 * while timespec.tv_nsec has a range of [0, NSEC_PER_SEC) */775775struct pps_normtime {776776- __kernel_time_t sec; /* seconds */776776+ s64 sec; /* seconds */777777 long nsec; /* nanoseconds */778778};779779780780/* normalize the timestamp so that nsec is in the781781 ( -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ] interval */782782-static inline struct pps_normtime pps_normalize_ts(struct timespec ts)782782+static inline struct pps_normtime pps_normalize_ts(struct timespec64 ts)783783{784784 struct pps_normtime norm = {785785 .sec = ts.tv_sec,···861861 pps_errcnt++;862862 pps_dec_freq_interval();863863 printk_deferred(KERN_ERR864864- "hardpps: PPSERROR: interval too long - %ld s\n",864864+ "hardpps: PPSERROR: interval too long - %lld s\n",865865 freq_norm.sec);866866 return 0;867867 }···948948 * This code is based on David Mills's reference nanokernel949949 * implementation. It was mostly rewritten but keeps the same idea.950950 */951951-void __hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts)951951+void __hardpps(const struct timespec64 *phase_ts, const struct timespec64 *raw_ts)952952{953953 struct pps_normtime pts_norm, freq_norm;954954···969969 }970970971971 /* ok, now we have a base for frequency calculation */972972- freq_norm = pps_normalize_ts(timespec_sub(*raw_ts, pps_fbase));972972+ freq_norm = pps_normalize_ts(timespec64_sub(*raw_ts, pps_fbase));973973974974 /* check that the signal is in the range975975 * [1s - MAXFREQ us, 1s + MAXFREQ us], otherwise reject it */
+1-1
kernel/time/ntp_internal.h
···99extern int second_overflow(unsigned long secs);1010extern int ntp_validate_timex(struct timex *);1111extern int __do_adjtimex(struct timex *, struct timespec64 *, s32 *);1212-extern void __hardpps(const struct timespec *, const struct timespec *);1212+extern void __hardpps(const struct timespec64 *, const struct timespec64 *);1313#endif /* _LINUX_NTP_INTERNAL_H */
+7-7
kernel/time/timekeeping.c
···849849#ifdef CONFIG_NTP_PPS850850851851/**852852- * getnstime_raw_and_real - get day and raw monotonic time in timespec format852852+ * ktime_get_raw_and_real_ts64 - get day and raw monotonic time in timespec format853853 * @ts_raw: pointer to the timespec to be set to raw monotonic time854854 * @ts_real: pointer to the timespec to be set to the time of day855855 *···857857 * same time atomically and stores the resulting timestamps in timespec858858 * format.859859 */860860-void getnstime_raw_and_real(struct timespec *ts_raw, struct timespec *ts_real)860860+void ktime_get_raw_and_real_ts64(struct timespec64 *ts_raw, struct timespec64 *ts_real)861861{862862 struct timekeeper *tk = &tk_core.timekeeper;863863 unsigned long seq;···868868 do {869869 seq = read_seqcount_begin(&tk_core.seq);870870871871- *ts_raw = timespec64_to_timespec(tk->raw_time);871871+ *ts_raw = tk->raw_time;872872 ts_real->tv_sec = tk->xtime_sec;873873 ts_real->tv_nsec = 0;874874···877877878878 } while (read_seqcount_retry(&tk_core.seq, seq));879879880880- timespec_add_ns(ts_raw, nsecs_raw);881881- timespec_add_ns(ts_real, nsecs_real);880880+ timespec64_add_ns(ts_raw, nsecs_raw);881881+ timespec64_add_ns(ts_real, nsecs_real);882882}883883-EXPORT_SYMBOL(getnstime_raw_and_real);883883+EXPORT_SYMBOL(ktime_get_raw_and_real_ts64);884884885885#endif /* CONFIG_NTP_PPS */886886···20252025/**20262026 * hardpps() - Accessor function to NTP __hardpps function20272027 */20282028-void hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts)20282028+void hardpps(const struct timespec64 *phase_ts, const struct timespec64 *raw_ts)20292029{20302030 unsigned long flags;20312031