summaryrefslogtreecommitdiff
path: root/drivers/ptp
diff options
context:
space:
mode:
authorPeter Hilber <peter.hilber@opensynergy.com>2024-02-01 02:04:49 +0100
committerThomas Gleixner <tglx@linutronix.de>2024-02-07 17:05:21 +0100
commit576bd4962f19bb8f437f8cecbb25e4202438c41e (patch)
treea439ff8bc5f25d132d9e9a5c2806b2fee37811be /drivers/ptp
parenta2c1fe72062a5dd69de4dfe892f6436d6c0479dd (diff)
x86/kvm, ptp/kvm: Add clocksource ID, set system_counterval_t.cs_id
Add a clocksource ID for the x86 kvmclock. Also, for ptp_kvm, set the recently added struct system_counterval_t member cs_id to the clocksource ID (x86 kvmclock or ARM Generic Timer). In the future, get_device_system_crosststamp() will compare the clocksource ID in struct system_counterval_t, rather than the clocksource. For now, to avoid touching too many subsystems at once, extract the clocksource ID from the clocksource. The clocksource dereference will be removed once everything is converted over.. Signed-off-by: Peter Hilber <peter.hilber@opensynergy.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240201010453.2212371-5-peter.hilber@opensynergy.com
Diffstat (limited to 'drivers/ptp')
-rw-r--r--drivers/ptp/ptp_kvm_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/ptp/ptp_kvm_common.c b/drivers/ptp/ptp_kvm_common.c
index 2418977989be..b0b36f135347 100644
--- a/drivers/ptp/ptp_kvm_common.c
+++ b/drivers/ptp/ptp_kvm_common.c
@@ -4,6 +4,7 @@
*
* Copyright (C) 2017 Red Hat Inc.
*/
+#include <linux/clocksource.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/init.h>
@@ -47,6 +48,7 @@ static int ptp_kvm_get_time_fn(ktime_t *device_time,
system_counter->cycles = cycle;
system_counter->cs = cs;
+ system_counter->cs_id = cs->id;
*device_time = timespec64_to_ktime(tspec);