[tip: timers/ptp] virtio_rtc: Use provided clock ID for history snapshot
From: tip-bot2 for Thomas Gleixner
Date: Tue Jun 02 2026 - 05:59:43 EST
The following commit has been merged into the timers/ptp branch of tip:
Commit-ID: babe4b6d03be8fe7787490d7b93f593134abc51e
Gitweb: https://git.kernel.org/tip/babe4b6d03be8fe7787490d7b93f593134abc51e
Author: Thomas Gleixner <tglx@xxxxxxxxxx>
AuthorDate: Fri, 29 May 2026 22:00:52 +02:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Tue, 02 Jun 2026 11:39:59 +02:00
virtio_rtc: Use provided clock ID for history snapshot
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@xxxxxxxxxx>
Tested-by: Arthur Kiyanovski <akiyano@xxxxxxxxxx>
Reviewed-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
Reviewed-by: Jacob Keller <jacob.e.keller@xxxxxxxxx>
Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
Link: https://patch.msgid.link/20260529195557.744271454@xxxxxxxxxx
---
drivers/virtio/virtio_rtc_ptp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_rtc_ptp.c b/drivers/virtio/virtio_rtc_ptp.c
index f845999..ff8d834 100644
--- a/drivers/virtio/virtio_rtc_ptp.c
+++ b/drivers/virtio/virtio_rtc_ptp.c
@@ -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;