Skip to content

Commit ef22786

Browse files
author
Thomas Gleixner
committed
timekeeping: Use system_time_snapshot::systime/monoraw instead of ::real/raw
system_time_snapshot::systime provides the same information as system_time_snapshot::real when the snapshot was taken with ktime_get_snapshot_id(CLOCK_REALTIME). Convert the history interpolation over to use 'systime' and 'monoraw' as 'real/raw' are going away once all users are converted. As a side effect this is the first step to support CLOCK_AUX with get_device_crosstime_stamp() and the history interpolation. Signed-off-by: Thomas Gleixner <tglx@kernel.org> Tested-by: David Woodhouse <dwmw@amazon.co.uk> Tested-by: Arthur Kiyanovski <akiyano@amazon.com> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20260529195557.024415766@kernel.org
1 parent eba3022 commit ef22786

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

kernel/time/timekeeping.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ static int adjust_historical_crosststamp(struct system_time_snapshot *history,
13231323
* partial_history_cycles / total_history_cycles
13241324
*/
13251325
corr_raw = (u64)ktime_to_ns(
1326-
ktime_sub(ts->sys_monoraw, history->raw));
1326+
ktime_sub(ts->sys_monoraw, history->monoraw));
13271327
ret = scale64_check_overflow(partial_history_cycles,
13281328
total_history_cycles, &corr_raw);
13291329
if (ret)
@@ -1341,7 +1341,7 @@ static int adjust_historical_crosststamp(struct system_time_snapshot *history,
13411341
(corr_raw, tk->tkr_mono.mult, tk->tkr_raw.mult);
13421342
} else {
13431343
corr_real = (u64)ktime_to_ns(
1344-
ktime_sub(ts->sys_realtime, history->real));
1344+
ktime_sub(ts->sys_realtime, history->systime));
13451345
ret = scale64_check_overflow(partial_history_cycles,
13461346
total_history_cycles, &corr_real);
13471347
if (ret)
@@ -1350,8 +1350,8 @@ static int adjust_historical_crosststamp(struct system_time_snapshot *history,
13501350

13511351
/* Fixup monotonic raw and real time time values */
13521352
if (interp_forward) {
1353-
ts->sys_monoraw = ktime_add_ns(history->raw, corr_raw);
1354-
ts->sys_realtime = ktime_add_ns(history->real, corr_real);
1353+
ts->sys_monoraw = ktime_add_ns(history->monoraw, corr_raw);
1354+
ts->sys_realtime = ktime_add_ns(history->systime, corr_real);
13551355
} else {
13561356
ts->sys_monoraw = ktime_sub_ns(ts->sys_monoraw, corr_raw);
13571357
ts->sys_realtime = ktime_sub_ns(ts->sys_realtime, corr_real);

0 commit comments

Comments
 (0)