Skip to content

Commit

Permalink
timekeeping: Fix bogus clock_was_set() invocation in do_adjtimex()
Browse files Browse the repository at this point in the history
The addition of the bases argument to clock_was_set() fixed up all call
sites correctly except for do_adjtimex(). This uses CLOCK_REALTIME
instead of CLOCK_SET_WALL as argument. CLOCK_REALTIME is 0.

As a result the effect of that clock_was_set() notification is incomplete
and might result in timers expiring late because the hrtimer code does
not re-evaluate the affected clock bases.

Use CLOCK_SET_WALL instead of CLOCK_REALTIME to tell the hrtimers code
which clock bases need to be re-evaluated.

Fixes: 17a1b88 ("hrtimer: Add bases argument to clock_was_set()")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/877ccx7igo.ffs@tglx
  • Loading branch information
Thomas Gleixner committed Aug 5, 2024
1 parent 06c03c8 commit 5916be8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -2606,7 +2606,7 @@ int do_adjtimex(struct __kernel_timex *txc)
clock_set |= timekeeping_advance(TK_ADV_FREQ);

if (clock_set)
clock_was_set(CLOCK_REALTIME);
clock_was_set(CLOCK_SET_WALL);

ntp_notify_cmos_timer();

Expand Down

0 comments on commit 5916be8

Please sign in to comment.