]> git.hungrycats.org Git - linux/commit
timekeeping: Update offsets on sequence counter retry in ktime_get_update_offsets_now()
authorThomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
Fri, 23 Oct 2026 11:49:17 +0000 (13:49 +0200)
committerThomas Gleixner <tglx@kernel.org>
Fri, 23 Oct 2026 19:52:01 +0000 (21:52 +0200)
commit6541fbc942f3b63bb8bd44e34eee6223e0abe719
treed2108cb0a660070c171af2a7256d1c93238ad57d
parent524d95c8a2000cba6cb80a173d76cb746c561244
timekeeping: Update offsets on sequence counter retry in ktime_get_update_offsets_now()

The sequence counter of the cwsseq target is modified during the
sequence counter loop. If the loop retries, cwsseq will now match
but the offsets contain the values from the previous loop iteration.
These are not guaranteed to be consistent in themselves or with the
current loops "now.

Save the target's original sequence counter value so that the update
also happens on loop retries.

Fixes: 868a3e915f7f ("hrtimer: Make offset update smarter")
Signed-off-by: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261023-timekeeping-clock_was_set_seq-v1-1-61c4c53d031c@linutronix.de
kernel/time/timekeeping.c