Re: [PATCH v2 09/25] timekeeping: Move timekeeper_lock into tk_core

From: John Stultz
Date: Thu Oct 24 2024 - 17:21:13 EST


On Wed, Oct 9, 2024 at 1:29 AM Anna-Maria Behnsen
<anna-maria@xxxxxxxxxxxxx> wrote:
>
> From: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxx>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>

Acked-by: John Stultz <jstultz@xxxxxxxxxx>