linux/kernel/time
Miroslav Lichvar fdc6bae940 ntp: Allow TAI-UTC offset to be set to zero
The ADJ_TAI adjtimex mode sets the TAI-UTC offset of the system clock.
It is typically set by NTP/PTP implementations and it is automatically
updated by the kernel on leap seconds. The initial value is zero (which
applications may interpret as unknown), but this value cannot be set by
adjtimex. This limitation seems to go back to the original "nanokernel"
implementation by David Mills.

Change the ADJ_TAI check to accept zero as a valid TAI-UTC offset in
order to allow setting it back to the initial value.

Fixes: 153b5d054a ("ntp: support for TAI")
Suggested-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Link: https://lkml.kernel.org/r/20190417084833.7401-1-mlichvar@redhat.com
2019-05-09 10:46:58 +02:00
..
alarmtimer.c alarmtimer: Return correct remaining time 2019-04-10 15:23:26 +02:00
clockevents.c hrtimers/tick/clockevents: Remove sloppy license references 2018-11-23 11:51:21 +01:00
clocksource.c time: Remove license boilerplate 2018-11-23 11:51:21 +01:00
hrtimer.c Merge branch 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-03-05 14:08:26 -08:00
itimer.c time: Remove useless filenames in top level comments 2018-11-23 11:51:20 +01:00
jiffies.c time/jiffies: Make refined_jiffies static 2019-03-22 13:38:26 +01:00
Kconfig time: Move CONTEXT_TRACKING to kernel/time/Kconfig 2019-01-15 11:16:41 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ntp_internal.h timex: use __kernel_timex internally 2019-02-07 00:13:27 +01:00
ntp.c ntp: Allow TAI-UTC offset to be set to zero 2019-05-09 10:46:58 +02:00
posix-clock.c timex: use __kernel_timex internally 2019-02-07 00:13:27 +01:00
posix-cpu-timers.c posix-cpu-timers: Remove private interval storage 2019-01-15 16:36:13 +01:00
posix-stubs.c y2038: syscalls: rename y2038 compat syscalls 2019-02-07 00:13:27 +01:00
posix-timers.c y2038: syscalls: rename y2038 compat syscalls 2019-02-07 00:13:27 +01:00
posix-timers.h timex: use __kernel_timex internally 2019-02-07 00:13:27 +01:00
sched_clock.c timers/sched_clock: Prevent generic sched_clock wrap caused by tick_freeze() 2019-04-18 14:34:53 +02:00
test_udelay.c time/debug: Remove license boilerplate 2018-11-23 11:51:21 +01:00
tick-broadcast-hrtimer.c time: Remove useless filenames in top level comments 2018-11-23 11:51:20 +01:00
tick-broadcast.c timers: Mark expected switch fall-throughs 2019-01-29 20:08:42 +01:00
tick-common.c timers/sched_clock: Prevent generic sched_clock wrap caused by tick_freeze() 2019-04-18 14:34:53 +02:00
tick-internal.h Revert: Unify CLOCK_MONOTONIC and CLOCK_BOOTTIME 2018-04-26 14:53:32 +02:00
tick-oneshot.c hrtimers/tick/clockevents: Remove sloppy license references 2018-11-23 11:51:21 +01:00
tick-sched.c hrtimers/tick/clockevents: Remove sloppy license references 2018-11-23 11:51:21 +01:00
tick-sched.h nohz: Gather tick_sched booleans under a common flag field 2018-04-09 11:54:57 +02:00
time.c y2038: rename old time and utime syscalls 2019-02-07 00:13:28 +01:00
timeconst.bc time: Add SPDX license identifiers 2018-11-23 11:51:20 +01:00
timeconv.c time: Add SPDX license identifiers 2018-11-23 11:51:20 +01:00
timecounter.c time: Remove license boilerplate 2018-11-23 11:51:21 +01:00
timekeeping_debug.c timekeeping/debug: No need to check return value of debugfs_create functions 2019-01-29 20:08:41 +01:00
timekeeping_internal.h timekeeping/ntp: Constify some function arguments 2018-07-19 17:08:05 -07:00
timekeeping.c timex: use __kernel_timex internally 2019-02-07 00:13:27 +01:00
timekeeping.h timers/sched_clock: Prevent generic sched_clock wrap caused by tick_freeze() 2019-04-18 14:34:53 +02:00
timer_list.c hrtimers/tick/clockevents: Remove sloppy license references 2018-11-23 11:51:21 +01:00
timer.c Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-03-05 14:49:11 -08:00