]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
virtio_rtc: Use provided clock ID for history snapshot
authorThomas Gleixner <tglx@kernel.org>
Fri, 29 May 2026 20:00:52 +0000 (22:00 +0200)
committerThomas Gleixner <tglx@kernel.org>
Thu, 4 Jun 2026 09:04:17 +0000 (11:04 +0200)
The PTP core indicates in system_device_crosststamp::clock_id the clock ID
for which the system time stamp should be taken. That allows to utilize
hardware timestamps with e.g. AUX clocks.

Use ktime_get_snapshot_id() and hand the provided clock ID in.

No functional change.

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: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20260529195557.744271454@kernel.org
drivers/virtio/virtio_rtc_ptp.c

index f84599950cd4d4f3cd3ef12a735b735538adaf12..ff8d834493dcbeeb50f6169a3bc3793e4db5e329 100644 (file)
@@ -139,7 +139,7 @@ static int viortc_ptp_getcrosststamp(struct ptp_clock_info *ptp,
        if (ret)
                return ret;
 
-       ktime_get_snapshot(&history_begin);
+       ktime_get_snapshot_id(xtstamp->clock_id, &history_begin);
        if (history_begin.cs_id != cs_id)
                return -EOPNOTSUPP;