[tip: timers/ptp] timekeeping: Add support for AUX clock cross timestamping

tip-bot2 for Thomas Gleixner posted 1 patch 5 days, 16 hours ago
There is a newer version of this series
kernel/time/timekeeping.c | 6 ++++++
1 file changed, 6 insertions(+)
[tip: timers/ptp] timekeeping: Add support for AUX clock cross timestamping
Posted by tip-bot2 for Thomas Gleixner 5 days, 16 hours ago
The following commit has been merged into the timers/ptp branch of tip:

Commit-ID:     7a58ec6a456cad02345cfbd949d8da6d5eaedd1d
Gitweb:        https://git.kernel.org/tip/7a58ec6a456cad02345cfbd949d8da6d5eaedd1d
Author:        Thomas Gleixner <tglx@kernel.org>
AuthorDate:    Fri, 29 May 2026 22:01:21 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 02 Jun 2026 11:40:00 +02:00

timekeeping: Add support for AUX clock cross timestamping

Now that all prerequisites are in place add the final support for AUX
clocks in get_device_system_crosststamp(), which enables the PTP layer to
support hardware cross timestamps with a new IOTCL.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
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/20260529195558.097464513@kernel.org
---
 kernel/time/timekeeping.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index dae61c9..65d870c 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1517,6 +1517,12 @@ int get_device_system_crosststamp(int (*get_time_fn)
 		tkd = &tk_core;
 		offs = &tk_core.timekeeper.offs_real;
 		break;
+	case CLOCK_AUX ... CLOCK_AUX_LAST:
+		tkd = aux_get_tk_data(xtstamp->clock_id);
+		if (!tkd)
+			return -ENODEV;
+		offs = &tkd->timekeeper.offs_aux;
+		break;
 	default:
 		WARN_ON_ONCE(1);
 		return -ENODEV;