[tip: timers/ptp] timekeeping: Remove system_time_snapshot::real/boot/raw

From: tip-bot2 for Thomas Gleixner

Date: Thu Jun 04 2026 - 05:14:34 EST


The following commit has been merged into the timers/ptp branch of tip:

Commit-ID: 705e1068071f82b6c66b9e28124fbb7123b04c1d
Gitweb: https://git.kernel.org/tip/705e1068071f82b6c66b9e28124fbb7123b04c1d
Author: Thomas Gleixner <tglx@xxxxxxxxxx>
AuthorDate: Fri, 29 May 2026 22:00:20 +02:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Thu, 04 Jun 2026 11:04:16 +02:00

timekeeping: Remove system_time_snapshot::real/boot/raw

All users are converted over to ktime_get_snapshot_id() and
system_time_snapshot::systime and ::monoraw.

Remove the leftovers.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Tested-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
Tested-by: Arthur Kiyanovski <akiyano@xxxxxxxxxx>
Reviewed-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
Reviewed-by: Jacob Keller <jacob.e.keller@xxxxxxxxx>
Link: https://patch.msgid.link/20260529195557.330029635@xxxxxxxxxx
---
include/linux/timekeeping.h | 10 +---------
kernel/time/timekeeping.c | 8 --------
2 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 161157c..eb64c90 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -280,9 +280,6 @@ static inline bool ktime_get_aux_ts64(clockid_t id, struct timespec64 *kt) { ret
* a selected CLOCK_* and the clocksource counter value
* @cycles: Clocksource counter value to produce the system times
* @systime: The system time of the selected CLOCK ID
- * @real: Realtime system time
- * @boot: Boot time
- * @raw: Monotonic raw system time
* @monoraw: Monotonic raw system time
* @cs_id: Clocksource ID
* @clock_was_set_seq: The sequence number of clock-was-set events
@@ -292,12 +289,7 @@ static inline bool ktime_get_aux_ts64(clockid_t id, struct timespec64 *kt) { ret
struct system_time_snapshot {
u64 cycles;
ktime_t systime;
- ktime_t real;
- ktime_t boot;
- union {
- ktime_t raw;
- ktime_t monoraw;
- };
+ ktime_t monoraw;
enum clocksource_ids cs_id;
unsigned int clock_was_set_seq;
u8 cs_was_changed_seq;
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index ccd04ad..a134b1b 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1196,8 +1196,6 @@ void ktime_get_snapshot_id(clockid_t clock_id, struct system_time_snapshot *syst
struct timekeeper *tk;
struct tk_data *tkd;
unsigned int seq;
- ktime_t base_real;
- ktime_t base_boot;

/* Invalidate the snapshot for all failure cases */
systime_snapshot->valid = false;
@@ -1239,18 +1237,12 @@ void ktime_get_snapshot_id(clockid_t clock_id, struct system_time_snapshot *syst
offs_sys = *offs;
base_raw = tk->tkr_raw.base;

- /* Kept around until the callers are fixed up */
- base_real = ktime_add(base_sys, tk_core.timekeeper.offs_real);
- base_boot = ktime_add(base_sys, tk_core.timekeeper.offs_boot);
-
nsec_sys = timekeeping_cycles_to_ns(&tk->tkr_mono, now);
nsec_raw = timekeeping_cycles_to_ns(&tk->tkr_raw, now);
} while (read_seqcount_retry(&tkd->seq, seq));

systime_snapshot->cycles = now;
systime_snapshot->systime = ktime_add_ns(base_sys, offs_sys + nsec_sys);
- systime_snapshot->real = ktime_add_ns(base_real, nsec_sys);
- systime_snapshot->boot = ktime_add_ns(base_boot, nsec_sys);
systime_snapshot->monoraw = ktime_add_ns(base_raw, nsec_raw);

/*