]> www.infradead.org Git - users/dwmw2/linux.git/commit
timekeeping: Move timekeeper_lock into tk_core
authorAnna-Maria Behnsen <anna-maria@linutronix.de>
Wed, 9 Oct 2024 08:29:02 +0000 (10:29 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 25 Oct 2024 17:49:14 +0000 (19:49 +0200)
commit8c4799b1845eabbdd820aa340f493ba8919af7a2
tree3420f5f69f368caad57c6fe1c34e8abcff7ff252
parentdbdcf8c4caeca8192daa43429ccf23a1feec126c
timekeeping: Move timekeeper_lock into tk_core

timekeeper_lock protects updates to struct tk_core but is not part of
struct tk_core. As long as there is only a single timekeeper, this is not a
problem. But when the timekeeper infrastructure will be reused for per ptp
clock timekeepers, timekeeper_lock needs to be part of tk_core.

Move the lock into tk_core, move initialisation of the lock and sequence
counter into timekeeping_init() and update all users of timekeeper_lock.

As this is touching all lock sites, convert them to use:

  guard(raw_spinlock_irqsave)(&tk_core.lock);

instead of lock/unlock functions whenever possible.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/all/20241009-devel-anna-maria-b4-timers-ptp-timekeeping-v2-9-554456a44a15@linutronix.de
kernel/time/timekeeping.c