]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
timekeeping: Add support for AUX clock cross timestamping
authorThomas Gleixner <tglx@kernel.org>
Fri, 29 May 2026 20:01:21 +0000 (22:01 +0200)
committerThomas Gleixner <tglx@kernel.org>
Thu, 4 Jun 2026 09:04:18 +0000 (11:04 +0200)
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

index dae61c9e31e6ede6cb0a1dfa2d034a1279f1f1ec..65d870c2d40d0f530881969bbf907ba5c283e0db 100644 (file)
@@ -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;