Message ID | 20241009-devel-anna-maria-b4-timers-ptp-timekeeping-v2-19-554456a44a15@linutronix.de (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | timekeeping: Rework to prepare support of indenpendent PTP clocks | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch |
On Wed, Oct 9, 2024 at 1:29 AM Anna-Maria Behnsen <anna-maria@linutronix.de> wrote: > > From: Anna-Maria Behnsen <anna-maria@linutronix.de> > > For timekeeping_init() the sequence count write held time is not relevant > and it could keep working on the real timekeeper, but there is no reason to > make it different from other timekeeper updates. > > Convert it to operate on the shadow timekeeper. > > Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de> > --- > kernel/time/timekeeping.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c > index 6d21e9bf5c35..bb225534fee1 100644 > --- a/kernel/time/timekeeping.c > +++ b/kernel/time/timekeeping.c > @@ -1778,7 +1778,7 @@ static bool persistent_clock_exists; > void __init timekeeping_init(void) > { > struct timespec64 wall_time, boot_offset, wall_to_mono; > - struct timekeeper *tk = &tk_core.timekeeper; > + struct timekeeper *tk = &tk_core.shadow_timekeeper; Same nit as earlier, otherwise Acked-by: John Stultz <jstultz@google.com>
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 6d21e9bf5c35..bb225534fee1 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1778,7 +1778,7 @@ static bool persistent_clock_exists; void __init timekeeping_init(void) { struct timespec64 wall_time, boot_offset, wall_to_mono; - struct timekeeper *tk = &tk_core.timekeeper; + struct timekeeper *tk = &tk_core.shadow_timekeeper; struct clocksource *clock; tkd_basic_setup(&tk_core); @@ -1802,7 +1802,7 @@ void __init timekeeping_init(void) wall_to_mono = timespec64_sub(boot_offset, wall_time); guard(raw_spinlock_irqsave)(&tk_core.lock); - write_seqcount_begin(&tk_core.seq); + ntp_init(); clock = clocksource_default_clock(); @@ -1815,9 +1815,7 @@ void __init timekeeping_init(void) tk_set_wall_to_mono(tk, wall_to_mono); - timekeeping_update(&tk_core, tk, TK_MIRROR | TK_CLOCK_WAS_SET); - - write_seqcount_end(&tk_core.seq); + timekeeping_update_staged(&tk_core, TK_CLOCK_WAS_SET); } /* time in seconds when suspend began for persistent clock */