summaryrefslogtreecommitdiffstats
path: root/include/linux/timekeeping.h
diff options
context:
space:
mode:
authorLakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>2024-05-13 16:08:02 +0530
committerThomas Gleixner <tglx@linutronix.de>2024-06-03 11:18:50 +0200
commit6b2e29977518ec13ef3022f234ff8f3014c243da (patch)
tree4dc1b302f1fa5373015d0227d86291e37004ded6 /include/linux/timekeeping.h
parent7cbf3b13f00c8341afff1c48ad83d11995842c40 (diff)
downloadlinux-6b2e29977518ec13ef3022f234ff8f3014c243da.tar.gz
linux-6b2e29977518ec13ef3022f234ff8f3014c243da.tar.bz2
linux-6b2e29977518ec13ef3022f234ff8f3014c243da.zip
timekeeping: Provide infrastructure for converting to/from a base clock
Hardware time stamps like provided by PTP clock implementations are based on a clock which feeds both the PCIe device and the system clock. For further processing the underlying hardwarre clock timestamp must be converted to the system clock. Right now this requires drivers to invoke an architecture specific conversion function, e.g. to convert the ART (Always Running Timer) timestamp to a TSC timestamp. As the system clock is aware of the underlying base clock, this can be moved to the core code by providing a base clock property for the system clock which contains the conversion factors and assigning a clocksource ID to the base clock. Add the required data structures and the conversion infrastructure in the core code to prepare for converting X86 and the related PTP drivers over. [ tglx: Added a missing READ_ONCE(). Massaged change log ] Co-developed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Co-developed-by: Christopher S. Hall <christopher.s.hall@intel.com> Signed-off-by: Christopher S. Hall <christopher.s.hall@intel.com> Signed-off-by: Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240513103813.5666-2-lakshmi.sowjanya.d@intel.com
Diffstat (limited to 'include/linux/timekeeping.h')
-rw-r--r--include/linux/timekeeping.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 0ea7823b7f31..b2ee182d891e 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -310,10 +310,12 @@ struct system_device_crosststamp {
* timekeeping code to verify comparability of two cycle values.
* The default ID, CSID_GENERIC, does not identify a specific
* clocksource.
+ * @use_nsecs: @cycles is in nanoseconds.
*/
struct system_counterval_t {
u64 cycles;
enum clocksource_ids cs_id;
+ bool use_nsecs;
};
/*