[RFC PATCH 0/2] ptp: add PTP_SYS_OFFSET_STAT ioctl, support it in virtio_rtc
From: Peter Hilber
Date: Thu Dec 19 2024 - 15:43:32 EST
This RFC patch series proposes a new ioctl PTP_SYS_OFFSET_STAT and adds
support for it in the proposed virtio_rtc driver [1]. The new
PTP_SYS_OFFSET_STAT ioctl provides a cross-timestamp like
PTP_SYS_OFFSET_PRECISE2, plus any the following status information (for
now):
- for UTC timescale clocks: leap second related status,
- clock accuracy.
The second commit adds support for the ioctl in the proposed virtio_rtc
driver, and hence depends on the patch series "Add virtio_rtc module" [1].
[1] https://lore.kernel.org/lkml/20241219201118.2233-1-quic_philber@xxxxxxxxxxx/T/#t
Signed-off-by: Peter Hilber <quic_philber@xxxxxxxxxxx>
Peter Hilber (2):
ptp: add PTP_SYS_OFFSET_STAT for xtstamping with status
virtio_rtc: Support PTP_SYS_OFFSET_STAT ioctl
drivers/ptp/ptp_chardev.c | 39 ++++++++
drivers/ptp/ptp_clock.c | 9 ++
drivers/virtio/Kconfig | 4 +-
drivers/virtio/virtio_rtc_driver.c | 122 +++++++++++++++++++++++-
drivers/virtio/virtio_rtc_internal.h | 3 +-
drivers/virtio/virtio_rtc_ptp.c | 25 +++--
include/linux/ptp_clock_kernel.h | 31 ++++++
include/uapi/linux/ptp_clock.h | 130 +++++++++++++++++++++++++-
tools/testing/selftests/ptp/Makefile | 2 +-
tools/testing/selftests/ptp/testptp.c | 126 ++++++++++++++++++++++++-
10 files changed, 471 insertions(+), 20 deletions(-)
base-commit: 8a8009abbfa04e58f1b01b20534cac9e8fe61a46
--
2.43.0