Re: [PATCH] ntp: Make sure RTC is synchronized for any time jump
From: Thomas Gleixner
Date: Tue Oct 15 2024 - 18:28:45 EST
On Sun, Oct 06 2024 at 18:58, Benjamin ROBIN wrote:
> @@ -2553,7 +2556,6 @@ int do_adjtimex(struct __kernel_timex *txc)
> {
> struct timekeeper *tk = &tk_core.timekeeper;
> struct audit_ntp_data ad;
> - bool offset_set = false;
> bool clock_set = false;
> struct timespec64 ts;
> unsigned long flags;
> @@ -2576,7 +2578,6 @@ int do_adjtimex(struct __kernel_timex *txc)
> if (ret)
> return ret;
>
> - offset_set = delta.tv_sec != 0;
> audit_tk_injoffset(delta);
> }
>
> @@ -2610,7 +2611,7 @@ int do_adjtimex(struct __kernel_timex *txc)
> if (clock_set)
> clock_was_set(CLOCK_SET_WALL);
>
> - ntp_notify_cmos_timer(offset_set);
> + ntp_notify_cmos_timer(false);
Can you please add a comment why this does not need to cancel the
hrtimer? It took me a few looks to validate that this is correct. Six
months down the road we both forgot about it. :)
Also can you please rebase this on top of
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
which has a larger change of the NTP code.
Thanks,
tglx