linux/drivers/ptp
Mahesh Bandewar c259acab83 ptp/ioctl: support MONOTONIC{,_RAW} timestamps for PTP_SYS_OFFSET_EXTENDED
The ability to read the PHC (Physical Hardware Clock) alongside
multiple system clocks is currently dependent on the specific
hardware architecture. This limitation restricts the use of
PTP_SYS_OFFSET_PRECISE to certain hardware configurations.

The generic soultion which would work across all architectures
is to read the PHC along with the latency to perform PHC-read as
offered by PTP_SYS_OFFSET_EXTENDED which provides pre and post
timestamps.  However, these timestamps are currently limited
to the CLOCK_REALTIME timebase. Since CLOCK_REALTIME is affected
by NTP (or similar time synchronization services), it can
experience significant jumps forward or backward. This hinders
the precise latency measurements that PTP_SYS_OFFSET_EXTENDED
is designed to provide.

This problem could be addressed by supporting MONOTONIC_RAW
timestamps within PTP_SYS_OFFSET_EXTENDED. Unlike CLOCK_REALTIME
or CLOCK_MONOTONIC, the MONOTONIC_RAW timebase is unaffected
by NTP adjustments.

This enhancement can be implemented by utilizing one of the three
reserved words within the PTP_SYS_OFFSET_EXTENDED struct to pass
the clock-id for timestamps.  The current behavior aligns with
clock-id for CLOCK_REALTIME timebase (value of 0), ensuring
backward compatibility of the UAPI.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-09-08 18:40:33 +01:00
..
Kconfig ptp: add FemtoClock3 Wireless as ptp hardware clock 2024-01-29 13:00:23 +00:00
Makefile ptp: add FemtoClock3 Wireless as ptp hardware clock 2024-01-29 13:00:23 +00:00
ptp_chardev.c ptp/ioctl: support MONOTONIC{,_RAW} timestamps for PTP_SYS_OFFSET_EXTENDED 2024-09-08 18:40:33 +01:00
ptp_clock.c ptp: Move from simple ida to xarray 2024-03-11 16:03:15 -07:00
ptp_clockmatrix.c ptp: ptp_clockmatrix: Convert to platform remove callback returning void 2024-04-12 18:51:39 -07:00
ptp_clockmatrix.h ptp: ptp_clockmatrix: Add .getmaxphase ptp_clock_info callback 2023-06-20 09:02:33 +01:00
ptp_dfl_tod.c ptp: add ToD device driver for Intel FPGA cards 2023-03-29 21:25:48 -07:00
ptp_dte.c ptp: ptp_dte: Convert to platform remove callback returning void 2024-04-12 18:51:39 -07:00
ptp_fc3.c ptp: fc3: Convert to platform remove callback returning void 2024-03-05 11:23:02 -08:00
ptp_fc3.h ptp: add FemtoClock3 Wireless as ptp hardware clock 2024-01-29 13:00:23 +00:00
ptp_idt82p33.c ptp: ptp_idt82p33: Convert comma to semicolon 2024-09-05 13:17:40 +02:00
ptp_idt82p33.h ptp: idt82p33: Add .getmaxphase ptp_clock_info callback 2023-06-20 09:02:33 +01:00
ptp_ines.c net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
ptp_kvm_arm.c treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
ptp_kvm_common.c treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
ptp_kvm_x86.c treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
ptp_mock.c net: ptp: create a mock-up PTP Hardware Clock driver 2023-08-09 15:59:21 -07:00
ptp_ocp.c ptp: ocp: Improve PCIe delay estimation 2024-09-06 18:28:07 -07:00
ptp_pch.c ptp_phc: convert .adjfreq to .adjfine 2022-11-11 10:58:39 +00:00
ptp_private.h ptp: make ptp_class constant 2024-03-11 13:42:09 -07:00
ptp_qoriq_debugfs.c
ptp_qoriq.c ptp: ptp_qoriq: Convert to platform remove callback returning void 2024-04-12 18:51:39 -07:00
ptp_sysfs.c ptp: fix integer overflow in max_vclocks_store 2024-06-18 13:26:44 -07:00
ptp_vclock.c ptp: make ptp_class constant 2024-03-11 13:42:09 -07:00
ptp_vmw.c ptp/vmware: Use VMware hypercall API 2024-06-25 17:15:47 +02:00