ptp: split non-NIC PHC drivers into the clock/timekeeping maintenance domain
Subsystems (14)
cover ptp: split non-NIC PHC drivers into the clock/timekeeping maintenance domain
Hi all,
This series follows the discussion in RFC v1 and RFC v2 [1-2].
# Background
The PTP Hardware Clock (PHC) interface (/dev/ptpX and the standard PTP_* ioctls) was originally introduced for IEEE 1588 / network oriented clock drivers. Over time, it has also become a common userspace API for many non-NIC high-precision clock implementations (virtualization/platform/architecture provided clocks) [3-7], and more are expected to appear [8-9].
During the review of these incoming non IEEE 1588 based PHC drivers, concerns were raised that such "non-NIC" clocks may not be a good fit for the netdev maintainership model [10], where PTP/PHC drivers are currently maintained. This leaves an unclear upstream home and maintainership model for this class of drivers.
# Proposal
This series proposes moving PHC drivers that expose a high-precision clock to userspace via the existing PTP interface (/dev/ptpX + standard PTP_* ioctls), but are not tied to the traditional NIC/IEEE 1588 packet timestamping pipeline, out of the netdev maintenance domain and into the clock/timekeeping maintenance domain.
As discussed in [1-2], this series makes the separation explicit by splitting drivers/ptp/ into the following groups. This structure provides clearer ownership and long-term maintenance boundaries:
- drivers/ptp/ : PTP core infrastructure and userspace ABI
(ptp_clock.c, ptp_chardev.c, ptp_sysfs.c,
ptp_vclock.c, etc.) remain here.
- drivers/ptp/ieee1588/ : network / IEEE 1588 oriented PTP drivers.
- drivers/ptp/emulated/ : non IEEE 1588 PTP drivers. They are typically platform/architecture/virtualization/special hardware provided high-precision time sources.
Patch 1 performs the refactor: move drivers and split Kconfig/Makefiles accordingly, without intended functional changes.
Patch 2 updates MAINTAINERS to match the new layout and adds a dedicated entry for drivers/ptp/emulated/, moving review and ownership routing for this class of drivers away from the netdev maintainership.
No userspace ABI changes are intended, this is a refactor and maintenance metadata update only.
# Changes since RFC v2:
- Keep ptp_ocp under the IEEE1588/network-oriented PTP drivers as suggested by Jakub.
- Following the model used by NTP related code, this series lists tip.git (timers/core) as the integration tree for emulated PTP clocks in the MAINTAINERS entry. Guidance from clock/timekeeping maintainers (Thomas Gleixner, John Stultz, Anna-Maria Behnsen, Frederic Weisbecker, Daniel Lezcano, Stephen Boyd) on whether this is the appropriate workflow for this class of drivers would be appreciated.
- Continue listing ourselves as maintainers for now as a fallback contact point. In the long term it would be preferable for this area to be maintained by clock/timekeeping experts, and suggestions are welcome.
Thanks for any input.
Regards.
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a0e136d436ded817c0aade72efdefa56a00b4e5e
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7d10001e20e46ad6ad95622164686bc2cbfc9802
[5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2d7de7a3010d713fb89b7ba99e6fdc14475ad106
[6] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3716a49a81ba19dda7202633a68b28564ba95eb5
[7] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9a17125a18f9ae1e1233a8e2d919059445b9d6fd
[8] https://lore.kernel.org/netdev/[email protected]/
[9] https://lore.kernel.org/mhi/[email protected]/
[10] https://lore.kernel.org/netdev/[email protected]/
Wen Gu (2):
ptp: split clock drivers into two subdirectories
MAINTAINERS: update PTP maintainer entries after directory split
MAINTAINERS | 38 ++-
drivers/ptp/Kconfig | 255 ++-----------------
drivers/ptp/Makefile | 27 +-
drivers/ptp/emulated/Kconfig | 61 +++++
drivers/ptp/emulated/Makefile | 11 +
drivers/ptp/{ => emulated}/ptp_kvm_arm.c | 0
drivers/ptp/{ => emulated}/ptp_kvm_common.c | 0
drivers/ptp/{ => emulated}/ptp_kvm_x86.c | 0
drivers/ptp/{ => emulated}/ptp_s390.c | 0
drivers/ptp/{ => emulated}/ptp_vmclock.c | 0
drivers/ptp/{ => emulated}/ptp_vmw.c | 0
drivers/ptp/ieee1588/Kconfig | 179 +++++++++++++
drivers/ptp/ieee1588/Makefile | 16 ++
drivers/ptp/{ => ieee1588}/ptp_clockmatrix.c | 0
drivers/ptp/{ => ieee1588}/ptp_clockmatrix.h | 0
drivers/ptp/{ => ieee1588}/ptp_dfl_tod.c | 0
drivers/ptp/{ => ieee1588}/ptp_dte.c | 0
drivers/ptp/{ => ieee1588}/ptp_fc3.c | 0
drivers/ptp/{ => ieee1588}/ptp_fc3.h | 0
drivers/ptp/{ => ieee1588}/ptp_idt82p33.c | 0
drivers/ptp/{ => ieee1588}/ptp_idt82p33.h | 0
drivers/ptp/{ => ieee1588}/ptp_ines.c | 0
drivers/ptp/{ => ieee1588}/ptp_mock.c | 0
drivers/ptp/{ => ieee1588}/ptp_netc.c | 0
drivers/ptp/{ => ieee1588}/ptp_ocp.c | 0
drivers/ptp/{ => ieee1588}/ptp_pch.c | 0
drivers/ptp/{ => ieee1588}/ptp_qoriq.c | 0
27 files changed, 322 insertions(+), 265 deletions(-)
create mode 100644 drivers/ptp/emulated/Kconfig
create mode 100644 drivers/ptp/emulated/Makefile
rename drivers/ptp/{ => emulated}/ptp_kvm_arm.c (100%)
rename drivers/ptp/{ => emulated}/ptp_kvm_common.c (100%)
rename drivers/ptp/{ => emulated}/ptp_kvm_x86.c (100%)
rename drivers/ptp/{ => emulated}/ptp_s390.c (100%)
rename drivers/ptp/{ => emulated}/ptp_vmclock.c (100%)
rename drivers/ptp/{ => emulated}/ptp_vmw.c (100%)
create mode 100644 drivers/ptp/ieee1588/Kconfig
create mode 100644 drivers/ptp/ieee1588/Makefile
rename drivers/ptp/{ => ieee1588}/ptp_clockmatrix.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_clockmatrix.h (100%)
rename drivers/ptp/{ => ieee1588}/ptp_dfl_tod.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_dte.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_fc3.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_fc3.h (100%)
rename drivers/ptp/{ => ieee1588}/ptp_idt82p33.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_idt82p33.h (100%)
rename drivers/ptp/{ => ieee1588}/ptp_ines.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_mock.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_netc.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_ocp.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_pch.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_qoriq.c (100%)Signature · 1 line
2.43.5
PATCH 2/2 MAINTAINERS: update PTP maintainer entries after directory split
Update MAINTAINERS to match the new drivers/ptp/ directory layout after splitting emulated and IEEE 1588 network-oriented drivers into subdirectories.
Adjust file patterns and per-driver entries to point to their new locations, and add a dedicated MAINTAINERS entry for the emulated PTP clock drivers.
--- MAINTAINERS | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-)
MAINTAINERS +26 -12
@@ -10250,7 +10250,7 @@ F: Documentation/devicetree/bindings/ptp/fsl,ptp.yaml F: drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp* F: drivers/net/ethernet/freescale/dpaa2/dprtc* F: drivers/net/ethernet/freescale/enetc/enetc_ptp.c -F: drivers/ptp/ptp_qoriq.c +F: drivers/ptp/ieee1588/ptp_qoriq.c F: include/linux/fsl/ptp_qoriq.h FREESCALE QUAD SPI DRIVER
@@ -13129,7 +13129,7 @@ INTEL PTP DFL ToD DRIVER L: [email protected] L: [email protected] S: Orphan -F: drivers/ptp/ptp_dfl_tod.c +F: drivers/ptp/ieee1588/ptp_dfl_tod.c INTEL QUADRATURE ENCODER PERIPHERAL DRIVER M: Ilpo Järvinen <[email protected]>
@@ -18309,7 +18309,10 @@ F: Documentation/devicetree/bindings/net/ F: Documentation/networking/net_cachelines/net_device.rst F: drivers/connector/ F: drivers/net/ -F: drivers/ptp/ +F: drivers/ptp/Kconfig +F: drivers/ptp/Makefile +F: drivers/ptp/ieee1588/ +F: drivers/ptp/ptp* F: drivers/s390/net/ F: include/dt-bindings/net/ F: include/linux/cn_proc.h
@@ -19092,7 +19095,7 @@ L: [email protected] L: [email protected] S: Maintained F: Documentation/devicetree/bindings/ptp/nxp,ptp-netc.yaml -F: drivers/ptp/ptp_netc.c +F: drivers/ptp/ieee1588/ptp_netc.c NXP PF5300/PF5301/PF5302 PMIC REGULATOR DEVICE DRIVER M: Woodrow Douglass <[email protected]>
@@ -19802,7 +19805,7 @@ OPENCOMPUTE PTP CLOCK DRIVER M: Vadim Fedorenko <[email protected]> L: [email protected] S: Maintained -F: drivers/ptp/ptp_ocp.c +F: drivers/ptp/ieee1588/ptp_ocp.c OPENCORES I2C BUS DRIVER M: Peter Korsgaard <[email protected]>
@@ -21238,15 +21241,26 @@ W: http://linuxptp.sourceforge.net/ F: Documentation/ABI/testing/sysfs-ptp F: Documentation/driver-api/ptp.rst F: drivers/net/phy/dp83640* -F: drivers/ptp/* +F: drivers/ptp/Kconfig +F: drivers/ptp/Makefile +F: drivers/ptp/ieee1588/ +F: drivers/ptp/ptp* F: include/linux/ptp_cl* K: (?:\b|_)ptp(?:\b|_) +PTP EMULATED CLOCK SUPPORT +M: Wen Gu <[email protected]> +M: Xuan Zhuo <[email protected]> +L: [email protected] +S: Maintained +T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core +F: drivers/ptp/emulated/ + PTP MOCKUP CLOCK SUPPORT M: Vladimir Oltean <[email protected]> L: [email protected] S: Maintained -F: drivers/ptp/ptp_mock.c +F: drivers/ptp/ieee1588/ptp_mock.c F: include/linux/ptp_mock.h PTP VIRTUAL CLOCK SUPPORT
@@ -21258,10 +21272,10 @@ F: net/ethtool/phc_vclocks.c PTP VMCLOCK SUPPORT M: David Woodhouse <[email protected]> -L: [email protected] +L: [email protected] S: Maintained F: Documentation/devicetree/bindings/ptp/amazon,vmclock.yaml -F: drivers/ptp/ptp_vmclock.c +F: drivers/ptp/emulated/ptp_vmclock.c F: include/uapi/linux/vmclock-abi.h PTRACE SUPPORT
@@ -23320,7 +23334,7 @@ S390 PTP DRIVER M: Sven Schnelle <[email protected]> L: [email protected] S: Supported -F: drivers/ptp/ptp_s390.c +F: drivers/ptp/emulated/ptp_s390.c S390 SCM DRIVER M: Vineeth Vijayan <[email protected]>
@@ -28216,9 +28230,9 @@ M: Nick Shi <[email protected]> R: Ajay Kaher <[email protected]> R: Alexey Makhalov <[email protected]> R: Broadcom internal kernel review list <[email protected]> -L: [email protected] +L: [email protected] S: Supported -F: drivers/ptp/ptp_vmw.c +F: drivers/ptp/emulated/ptp_vmw.c VMWARE VMCI DRIVER M: Bryan Tan <[email protected]>
Signature · 1 line
2.43.5
PATCH 1/2 ptp: split clock drivers into two subdirectories
In reply to Wen GuThe PTP subsystem has grown beyond the original IEEE 1588/NIC use case and today contains both network-oriented PHC drivers and various emulated/virtual clock implementations.
Prepare for clearer ownership and future maintenance by refactoring drivers/ptp/ to make the split explicit. Keep the PTP core infrastructure in drivers/ptp/ and move the drivers into two new subdirectories:
- drivers/ptp/ieee1588/ : network/IEEE 1588 oriented drivers
- drivers/ptp/emulated/ : emulated/virtual/non-NIC implementations
Move the corresponding Kconfig entries into the new directories and include them from drivers/ptp/Kconfig. Update the top-level drivers/ptp/Makefile to build the core as before and recurse into the two subdirectories.
No functional changes are intended; this is a refactor only.
---
drivers/ptp/Kconfig | 255 ++-----------------
drivers/ptp/Makefile | 27 +-
drivers/ptp/emulated/Kconfig | 61 +++++
drivers/ptp/emulated/Makefile | 11 +
drivers/ptp/{ => emulated}/ptp_kvm_arm.c | 0
drivers/ptp/{ => emulated}/ptp_kvm_common.c | 0
drivers/ptp/{ => emulated}/ptp_kvm_x86.c | 0
drivers/ptp/{ => emulated}/ptp_s390.c | 0
drivers/ptp/{ => emulated}/ptp_vmclock.c | 0
drivers/ptp/{ => emulated}/ptp_vmw.c | 0
drivers/ptp/ieee1588/Kconfig | 179 +++++++++++++
drivers/ptp/ieee1588/Makefile | 16 ++
drivers/ptp/{ => ieee1588}/ptp_clockmatrix.c | 0
drivers/ptp/{ => ieee1588}/ptp_clockmatrix.h | 0
drivers/ptp/{ => ieee1588}/ptp_dfl_tod.c | 0
drivers/ptp/{ => ieee1588}/ptp_dte.c | 0
drivers/ptp/{ => ieee1588}/ptp_fc3.c | 0
drivers/ptp/{ => ieee1588}/ptp_fc3.h | 0
drivers/ptp/{ => ieee1588}/ptp_idt82p33.c | 0
drivers/ptp/{ => ieee1588}/ptp_idt82p33.h | 0
drivers/ptp/{ => ieee1588}/ptp_ines.c | 0
drivers/ptp/{ => ieee1588}/ptp_mock.c | 0
drivers/ptp/{ => ieee1588}/ptp_netc.c | 0
drivers/ptp/{ => ieee1588}/ptp_ocp.c | 0
drivers/ptp/{ => ieee1588}/ptp_pch.c | 0
drivers/ptp/{ => ieee1588}/ptp_qoriq.c | 0
26 files changed, 296 insertions(+), 253 deletions(-)
create mode 100644 drivers/ptp/emulated/Kconfig
create mode 100644 drivers/ptp/emulated/Makefile
rename drivers/ptp/{ => emulated}/ptp_kvm_arm.c (100%)
rename drivers/ptp/{ => emulated}/ptp_kvm_common.c (100%)
rename drivers/ptp/{ => emulated}/ptp_kvm_x86.c (100%)
rename drivers/ptp/{ => emulated}/ptp_s390.c (100%)
rename drivers/ptp/{ => emulated}/ptp_vmclock.c (100%)
rename drivers/ptp/{ => emulated}/ptp_vmw.c (100%)
create mode 100644 drivers/ptp/ieee1588/Kconfig
create mode 100644 drivers/ptp/ieee1588/Makefile
rename drivers/ptp/{ => ieee1588}/ptp_clockmatrix.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_clockmatrix.h (100%)
rename drivers/ptp/{ => ieee1588}/ptp_dfl_tod.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_dte.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_fc3.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_fc3.h (100%)
rename drivers/ptp/{ => ieee1588}/ptp_idt82p33.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_idt82p33.h (100%)
rename drivers/ptp/{ => ieee1588}/ptp_ines.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_mock.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_netc.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_ocp.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_pch.c (100%)
rename drivers/ptp/{ => ieee1588}/ptp_qoriq.c (100%)drivers/ptp/Kconfig +22 -233
@@ -12,17 +12,27 @@ config PTP_1588_CLOCK select PPS select NET_PTP_CLASSIFY help - The IEEE 1588 standard defines a method to precisely - synchronize distributed clocks over Ethernet networks. The - standard defines a Precision Time Protocol (PTP), which can - be used to achieve synchronization within a few dozen - microseconds. In addition, with the help of special hardware - time stamping units, it can be possible to achieve - synchronization to within a few hundred nanoseconds. + Enable the core infrastructure for PTP (Precision Time Protocol) + clock devices - This driver adds support for PTP clocks as character - devices. If you want to use a PTP clock, then you should - also enable at least one clock driver as well. + The core provides the common user space interfaces for PTP + clocks, including the character device (/dev/ptpX), sysfs + attributes and ioctl operations. + + This infrastructure was originally introduced for hardware + clocks on network devices implementing IEEE 1588 to + synchronize distributed clocks over Ethernet networks. With + special hardware time stamping units, synchronization within + a few dozen microseconds, and in some cases a few hundred + nanoseconds, can be achieved. + + Over time it has evolved into a generic clock device framework + and is also used by other high precision clocks exposed by + platforms, hypervisors or special hardware, even when those + clocks are not synchronized via IEEE 1588 over a network. + + If you want to use any PTP clock device, enable this option and + at least one clock driver. To compile this driver as a module, choose M here: the module will be called ptp.
@@ -39,228 +49,7 @@ config PTP_1588_CLOCK_OPTIONAL If PTP support is disabled, this dependency will still be met, and drivers refer to dummy helpers. -config PTP_1588_CLOCK_DTE - tristate "Broadcom DTE as PTP clock" - depends on PTP_1588_CLOCK - depends on NET && HAS_IOMEM - depends on ARCH_BCM_MOBILE || (ARCH_BCM_IPROC && !(ARCH_BCM_NSP || ARCH_BCM_5301X)) || COMPILE_TEST - default y if ARCH_BCM_MOBILE || ARCH_BCM_IPROC - help - This driver adds support for using the Digital timing engine - (DTE) in the Broadcom SoC's as a PTP clock. - - The clock can be used in both wired and wireless networks - for PTP purposes. - - To compile this driver as a module, choose M here: the module - will be called ptp_dte. - -config PTP_1588_CLOCK_QORIQ - tristate "Freescale QorIQ 1588 timer as PTP clock" - depends on GIANFAR || FSL_DPAA_ETH || FSL_DPAA2_ETH || FSL_ENETC || FSL_ENETC_VF || COMPILE_TEST - depends on PTP_1588_CLOCK - default y if GIANFAR || FSL_DPAA_ETH || FSL_DPAA2_ETH || FSL_ENETC || FSL_ENETC_VF - help - This driver adds support for using the Freescale QorIQ 1588 - timer as a PTP clock. This clock is only useful if your PTP - programs are getting hardware time stamps on the PTP Ethernet - packets using the SO_TIMESTAMPING API. - - To compile this driver as a module, choose M here: the module - will be called ptp_qoriq. - -comment "Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks." - depends on PHYLIB=n || NETWORK_PHY_TIMESTAMPING=n - -config DP83640_PHY - tristate "Driver for the National Semiconductor DP83640 PHYTER" - depends on NETWORK_PHY_TIMESTAMPING - depends on PHYLIB - depends on PTP_1588_CLOCK - select CRC32 - help - Supports the DP83640 PHYTER with IEEE 1588 features. - - This driver adds support for using the DP83640 as a PTP - clock. This clock is only useful if your PTP programs are - getting hardware time stamps on the PTP Ethernet packets - using the SO_TIMESTAMPING API. - - In order for this to work, your MAC driver must also - implement the skb_tx_timestamp() function. - -config PTP_1588_CLOCK_INES - tristate "ZHAW InES PTP time stamping IP core" - depends on NETWORK_PHY_TIMESTAMPING - depends on HAS_IOMEM - depends on PHYLIB - depends on PTP_1588_CLOCK - help - This driver adds support for using the ZHAW InES 1588 IP - core. This clock is only useful if the MII bus of your MAC - is wired up to the core. - -config PTP_1588_CLOCK_PCH - tristate "Intel PCH EG20T as PTP clock" - depends on MIPS_GENERIC || X86_32 || COMPILE_TEST - depends on HAS_IOMEM && PCI - depends on NET - depends on PTP_1588_CLOCK - help - This driver adds support for using the PCH EG20T as a PTP - clock. The hardware supports time stamping of PTP packets - when using the end-to-end delay (E2E) mechanism. The peer - delay mechanism (P2P) is not supported. - - This clock is only useful if your PTP programs are getting - hardware time stamps on the PTP Ethernet packets using the - SO_TIMESTAMPING API. - - To compile this driver as a module, choose M here: the module - will be called ptp_pch. - -config PTP_1588_CLOCK_KVM - tristate "KVM virtual PTP clock" - depends on PTP_1588_CLOCK - depends on (KVM_GUEST && X86) || (HAVE_ARM_SMCCC_DISCOVERY && ARM_ARCH_TIMER) - default y - help - This driver adds support for using kvm infrastructure as a PTP - clock. This clock is only useful if you are using KVM guests. - - To compile this driver as a module, choose M here: the module - will be called ptp_kvm. - -config PTP_1588_CLOCK_VMCLOCK - tristate "Virtual machine PTP clock" - depends on X86_TSC || ARM_ARCH_TIMER - depends on PTP_1588_CLOCK && ARCH_SUPPORTS_INT128 - default PTP_1588_CLOCK_KVM - help - This driver adds support for using a virtual precision clock - advertised by the hypervisor. This clock is only useful in virtual - machines where such a device is present. - - Unlike the KVM virtual PTP clock, the VMCLOCK device offers support - for reliable timekeeping even across live migration. So this driver - is enabled by default whenever the KVM PTP clock is. - - To compile this driver as a module, choose M here: the module - will be called ptp_vmclock. - -config PTP_1588_CLOCK_IDT82P33 - tristate "IDT 82P33xxx PTP clock" - depends on PTP_1588_CLOCK && I2C - default n - help - This driver adds support for using the IDT 82P33xxx as a PTP - clock. This clock is only useful if your time stamping MAC - is connected to the IDT chip. - - To compile this driver as a module, choose M here: the module - will be called ptp_idt82p33. - -config PTP_1588_CLOCK_IDTCM - tristate "IDT CLOCKMATRIX as PTP clock" - depends on PTP_1588_CLOCK && I2C - default n - help - This driver adds support for using IDT CLOCKMATRIX(TM) as a PTP - clock. This clock is only useful if your time stamping MAC - is connected to the IDT chip. - - To compile this driver as a module, choose M here: the module - will be called ptp_clockmatrix. - -config PTP_1588_CLOCK_FC3W - tristate "RENESAS FemtoClock3 Wireless as PTP clock" - depends on PTP_1588_CLOCK && I2C - default n - help - This driver adds support for using Renesas FemtoClock3 Wireless - as a PTP clock. This clock is only useful if your time stamping - MAC is connected to the RENESAS chip. - - To compile this driver as a module, choose M here: the module - will be called ptp_fc3. - -config PTP_1588_CLOCK_MOCK - tristate "Mock-up PTP clock" - depends on PTP_1588_CLOCK - help - This driver offers a set of PTP clock manipulation operations over - the system monotonic time. It can be used by virtual network device - drivers to emulate PTP capabilities. - - To compile this driver as a module, choose M here: the module - will be called ptp_mock. - -config PTP_1588_CLOCK_VMW - tristate "VMware virtual PTP clock" - depends on ACPI && HYPERVISOR_GUEST && X86 - depends on PTP_1588_CLOCK - help - This driver adds support for using VMware virtual precision - clock device as a PTP clock. This is only useful in virtual - machines running on VMware virtual infrastructure. - - To compile this driver as a module, choose M here: the module - will be called ptp_vmw. - -config PTP_1588_CLOCK_OCP - tristate "OpenCompute TimeCard as PTP clock" - depends on PTP_1588_CLOCK - depends on HAS_IOMEM && PCI - depends on I2C && MTD - depends on SERIAL_8250 - depends on !S390 - depends on COMMON_CLK - select NET_DEVLINK - select CRC16 - select DPLL - help - This driver adds support for an OpenCompute time card. - - The OpenCompute time card is an atomic clock along with - a GPS receiver that provides a Grandmaster clock source - for a PTP enabled network. - - More information is available at http://www.timingcard.com/ - -config PTP_DFL_TOD - tristate "FPGA DFL ToD Driver" - depends on FPGA_DFL - depends on PTP_1588_CLOCK - help - The DFL (Device Feature List) device driver for the Intel ToD - (Time-of-Day) device in FPGA card. The ToD IP within the FPGA - is exposed as PTP Hardware Clock (PHC) device to the Linux PTP - stack to synchronize the system clock to its ToD information - using phc2sys utility of the Linux PTP stack. - - To compile this driver as a module, choose M here: the module - will be called ptp_dfl_tod. - -config PTP_S390 - tristate "S390 PTP driver" - depends on PTP_1588_CLOCK - depends on S390 - help - This driver adds support for S390 time steering via the PtP - interface. This works by adding a in-kernel clock delta value, - which is always added to time values used in the kernel. The PtP - driver provides the raw clock value without the delta to - userspace. That way userspace programs like chrony could steer - the kernel clock. - -config PTP_NETC_V4_TIMER - tristate "NXP NETC V4 Timer PTP Driver" - depends on PTP_1588_CLOCK - depends on PCI_MSI - help - This driver adds support for using the NXP NETC V4 Timer as a PTP - clock, the clock is used by ENETC V4 or NETC V4 Switch for PTP time - synchronization. It also supports periodic output signal (e.g. PPS) - and external trigger timestamping. +source "drivers/ptp/ieee1588/Kconfig" +source "drivers/ptp/emulated/Kconfig" endmenu
drivers/ptp/Makefile +7 -20
@@ -1,24 +1,11 @@ # SPDX-License-Identifier: GPL-2.0 # -# Makefile for PTP 1588 clock support. +# Makefile for PTP clock support. # -ptp-y := ptp_clock.o ptp_chardev.o ptp_sysfs.o ptp_vclock.o -ptp_kvm-$(CONFIG_X86) := ptp_kvm_x86.o ptp_kvm_common.o -ptp_kvm-$(CONFIG_HAVE_ARM_SMCCC) := ptp_kvm_arm.o ptp_kvm_common.o -obj-$(CONFIG_PTP_1588_CLOCK) += ptp.o -obj-$(CONFIG_PTP_1588_CLOCK_DTE) += ptp_dte.o -obj-$(CONFIG_PTP_1588_CLOCK_INES) += ptp_ines.o -obj-$(CONFIG_PTP_1588_CLOCK_PCH) += ptp_pch.o -obj-$(CONFIG_PTP_1588_CLOCK_KVM) += ptp_kvm.o -obj-$(CONFIG_PTP_1588_CLOCK_VMCLOCK) += ptp_vmclock.o -obj-$(CONFIG_PTP_1588_CLOCK_QORIQ) += ptp_qoriq.o -obj-$(CONFIG_PTP_1588_CLOCK_IDTCM) += ptp_clockmatrix.o -obj-$(CONFIG_PTP_1588_CLOCK_FC3W) += ptp_fc3.o -obj-$(CONFIG_PTP_1588_CLOCK_IDT82P33) += ptp_idt82p33.o -obj-$(CONFIG_PTP_1588_CLOCK_MOCK) += ptp_mock.o -obj-$(CONFIG_PTP_1588_CLOCK_VMW) += ptp_vmw.o -obj-$(CONFIG_PTP_1588_CLOCK_OCP) += ptp_ocp.o -obj-$(CONFIG_PTP_DFL_TOD) += ptp_dfl_tod.o -obj-$(CONFIG_PTP_S390) += ptp_s390.o -obj-$(CONFIG_PTP_NETC_V4_TIMER) += ptp_netc.o +subdir-ccflags-y += -I$(srctree)/drivers/ptp + +ptp-y := ptp_clock.o ptp_chardev.o ptp_sysfs.o ptp_vclock.o +obj-$(CONFIG_PTP_1588_CLOCK) += ptp.o +obj-$(CONFIG_PTP_1588_CLOCK) += emulated/ +obj-$(CONFIG_PTP_1588_CLOCK) += ieee1588/
drivers/ptp/emulated/Kconfig new file +61 -0
61 lines not on this page · raw message
drivers/ptp/emulated/Makefile new file +11 -0
@@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for emulated PTP clocks. +# + +ptp_kvm-$(CONFIG_X86) := ptp_kvm_x86.o ptp_kvm_common.o +ptp_kvm-$(CONFIG_HAVE_ARM_SMCCC) := ptp_kvm_arm.o ptp_kvm_common.o +obj-$(CONFIG_PTP_1588_CLOCK_KVM) += ptp_kvm.o +obj-$(CONFIG_PTP_1588_CLOCK_VMCLOCK) += ptp_vmclock.o +obj-$(CONFIG_PTP_1588_CLOCK_VMW) += ptp_vmw.o +obj-$(CONFIG_PTP_S390) += ptp_s390.o
drivers/ptp/emulated/ptp_kvm_arm.c renamed from drivers/ptp/ptp_kvm_arm.c +0 -0
drivers/ptp/emulated/ptp_kvm_common.c renamed from drivers/ptp/ptp_kvm_common.c +0 -0
drivers/ptp/emulated/ptp_kvm_x86.c renamed from drivers/ptp/ptp_kvm_x86.c +0 -0
drivers/ptp/emulated/ptp_s390.c renamed from drivers/ptp/ptp_s390.c +0 -0
drivers/ptp/emulated/ptp_vmclock.c renamed from drivers/ptp/ptp_vmclock.c +0 -0
drivers/ptp/emulated/ptp_vmw.c renamed from drivers/ptp/ptp_vmw.c +0 -0
drivers/ptp/ieee1588/Kconfig new file +179 -0
179 lines not on this page · raw message
drivers/ptp/ieee1588/Makefile new file +16 -0
@@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for IEEE 1588 network-oriented PTP clocks. +# + +obj-$(CONFIG_PTP_1588_CLOCK_DTE) += ptp_dte.o +obj-$(CONFIG_PTP_1588_CLOCK_INES) += ptp_ines.o +obj-$(CONFIG_PTP_1588_CLOCK_PCH) += ptp_pch.o +obj-$(CONFIG_PTP_1588_CLOCK_QORIQ) += ptp_qoriq.o +obj-$(CONFIG_PTP_1588_CLOCK_IDTCM) += ptp_clockmatrix.o +obj-$(CONFIG_PTP_1588_CLOCK_FC3W) += ptp_fc3.o +obj-$(CONFIG_PTP_1588_CLOCK_IDT82P33) += ptp_idt82p33.o +obj-$(CONFIG_PTP_1588_CLOCK_MOCK) += ptp_mock.o +obj-$(CONFIG_PTP_1588_CLOCK_OCP) += ptp_ocp.o +obj-$(CONFIG_PTP_DFL_TOD) += ptp_dfl_tod.o +obj-$(CONFIG_PTP_NETC_V4_TIMER) += ptp_netc.o
drivers/ptp/ieee1588/ptp_clockmatrix.c renamed from drivers/ptp/ptp_clockmatrix.c +0 -0
drivers/ptp/ieee1588/ptp_clockmatrix.h renamed from drivers/ptp/ptp_clockmatrix.h +0 -0
drivers/ptp/ieee1588/ptp_dfl_tod.c renamed from drivers/ptp/ptp_dfl_tod.c +0 -0
drivers/ptp/ieee1588/ptp_dte.c renamed from drivers/ptp/ptp_dte.c +0 -0
drivers/ptp/ieee1588/ptp_fc3.c renamed from drivers/ptp/ptp_fc3.c +0 -0
drivers/ptp/ieee1588/ptp_fc3.h renamed from drivers/ptp/ptp_fc3.h +0 -0
drivers/ptp/ieee1588/ptp_idt82p33.c renamed from drivers/ptp/ptp_idt82p33.c +0 -0
drivers/ptp/ieee1588/ptp_idt82p33.h renamed from drivers/ptp/ptp_idt82p33.h +0 -0
drivers/ptp/ieee1588/ptp_ines.c renamed from drivers/ptp/ptp_ines.c +0 -0
drivers/ptp/ieee1588/ptp_mock.c renamed from drivers/ptp/ptp_mock.c +0 -0
drivers/ptp/ieee1588/ptp_netc.c renamed from drivers/ptp/ptp_netc.c +0 -0
drivers/ptp/ieee1588/ptp_ocp.c renamed from drivers/ptp/ptp_ocp.c +0 -0
drivers/ptp/ieee1588/ptp_pch.c renamed from drivers/ptp/ptp_pch.c +0 -0
drivers/ptp/ieee1588/ptp_qoriq.c renamed from drivers/ptp/ptp_qoriq.c +0 -0
Signature · 1 line
2.43.5
Quoted 6 lines · Wen Gu
- Following the model used by NTP related code, this series lists tip.git (timers/core) as the integration tree for emulated PTP clocks in the
MAINTAINERSentry. Guidance from clock/timekeeping maintainers (Thomas Gleixner, John Stultz, Anna-Maria Behnsen, Frederic Weisbecker, Daniel Lezcano, Stephen Boyd) on whether this is the appropriate workflow for this class of drivers would be appreciated.
While I'm sure it would be good to continue to CC folks, I'm not sure if the timekeeping maintainers would be the right folks for these driver/ptp/ changes to flow through.
Thomas has been doing the heavy lifting for a long while and I'd not want to put more on his shoulders.
Richard is listed as the maintainer for drivers/ptp/, is there any reason for it not to go through him?
thanks
-john
Quoted 14 lines · John Stultz
Quoted 6 lines · Wen Gu
- Following the model used by NTP related code, this series lists tip.git (timers/core) as the integration tree for emulated PTP clocks in the
MAINTAINERSentry. Guidance from clock/timekeeping maintainers (Thomas Gleixner, John Stultz, Anna-Maria Behnsen, Frederic Weisbecker, Daniel Lezcano, Stephen Boyd) on whether this is the appropriate workflow for this class of drivers would be appreciated.While I'm sure it would be good to continue to CC folks, I'm not sure if the timekeeping maintainers would be the right folks for these driver/ptp/ changes to flow through.
Thomas has been doing the heavy lifting for a long while and I'd not want to put more on his shoulders.
Quoted 5 lines
Richard is listed as the maintainer for
drivers/ptp/, is there any reason for it not to go through him?thanks
-john
Hi John,
Thanks a lot for the feedback.
Richard is indeed listed as the maintainer for the PTP subsystem and the traditional network-oriented PHC drivers. The intention of this series is not to bypass that role. I would very much welcome Richard's thoughts on the proposed split and the appropriate workflow for these drivers.
Historically the PTP subsystem lived under networking because the original PHC devices were tightly coupled with NIC hardware and the IEEE1588 packet timestamping pipeline.
Over time, however, the PTP userspace interface (/dev/ptpX together with the PTP_* ioctls) has also become a widely used way to expose high-precision clocks to userspace. Because of the stable interface and the existing ecosystem (e.g. chrony, phc2sys), many platform or virtualization-provided clocks have started reusing the same PTP interface.
As a result, drivers/ptp/ now contains two different classes of
devices: traditional network-oriented PHC drivers and clocks which are not tied to the IEEE1588 networking pipeline.
The difficulty today is that there is no very clear upstream path for this class of drivers: they currently live under drivers/ptp/, but their design and review concerns are often closer to clock/timekeeping topics than to networking. This series tries to find a clearer upstream path and review route for this class of drivers.
Regarding the merge path, the suggestion about tip.git was mainly an attempt to identify a possible integration tree for these drivers, but I'm open to suggestions if there is a better workflow.
Thanks again for taking a look.
Wen Gu
Jakub Kicinski
maintainerRe: [PATCH 1/2] ptp: split clock drivers into two subdirectories
In reply to Wen GuQuoted 17 lines · On Wed, 18 Mar 2026 15:33:29 +0800 Wen Gu wrote:
drivers/ptp/emulated/Kconfig | 61 +++++
drivers/ptp/emulated/Makefile | 11 +
drivers/ptp/{ => emulated}/ptp_kvm_arm.c | 0
drivers/ptp/{ => emulated}/ptp_kvm_common.c | 0
drivers/ptp/{ => emulated}/ptp_kvm_x86.c | 0
drivers/ptp/{ => emulated}/ptp_s390.c | 0
drivers/ptp/{ => emulated}/ptp_vmclock.c | 0
drivers/ptp/{ => emulated}/ptp_vmw.c | 0
drivers/ptp/ieee1588/Kconfig | 179 +++++++++++++
drivers/ptp/ieee1588/Makefile | 16 ++
drivers/ptp/{ => ieee1588}/ptp_clockmatrix.c | 0
drivers/ptp/{ => ieee1588}/ptp_clockmatrix.h | 0
drivers/ptp/{ => ieee1588}/ptp_dfl_tod.c | 0
drivers/ptp/{ => ieee1588}/ptp_dte.c | 0
drivers/ptp/{ => ieee1588}/ptp_fc3.c | 0
drivers/ptp/{ => ieee1588}/ptp_fc3.h | 0
drivers/ptp/{ => ieee1588}/ptp_idt82p33.c | 0Quoted 8 lines
drivers/ptp/{ => ieee1588}/ptp_idt82p33.h | 0
drivers/ptp/{ => ieee1588}/ptp_ines.c | 0
drivers/ptp/{ => ieee1588}/ptp_mock.c | 0
drivers/ptp/{ => ieee1588}/ptp_netc.c | 0
drivers/ptp/{ => ieee1588}/ptp_ocp.c | 0
drivers/ptp/{ => ieee1588}/ptp_pch.c | 0
drivers/ptp/{ => ieee1588}/ptp_qoriq.c | 0
26 files changed, 296 insertions(+), 253 deletions(-)emulated sounds good but the ieee1588 doesn't sit well with me. IEEE1588 doesn't describe tickers and external signals. Let's leave them in the main directory? Or call it hw even if it's not 100% accurate? In MAINTAINERS you can exclude subdir with X:
Jakub Kicinski
maintainerRe: [PATCH 2/2] MAINTAINERS: update PTP maintainer entries after directory split
In reply to Wen GuMAINTAINERS W: http://linuxptp.sourceforge.net/ · line 21255
Quoted 5 lines · On Wed, 18 Mar 2026 15:33:30 +0800 Wen Gu wrote:
MAINTAINERS +5
-0+PTP EMULATED CLOCK SUPPORT +M: Wen Gu <[email protected]> +M: Xuan Zhuo <[email protected]> +L: [email protected] +S: Maintained
I thought David W was supposed to be the main maintainer? Two moderately known developers from a single vendor/company is not enough to delegate this IMO.
Re: [PATCH 1/2] ptp: split clock drivers into two subdirectories
In reply to Jakub KicinskiQuoted 27 lines · Jakub Kicinski
Quoted 17 lines · On Wed, 18 Mar 2026 15:33:29 +0800 Wen Gu wrote:
drivers/ptp/emulated/Kconfig | 61 +++++ drivers/ptp/emulated/Makefile | 11 + drivers/ptp/{ => emulated}/ptp_kvm_arm.c | 0 drivers/ptp/{ => emulated}/ptp_kvm_common.c | 0 drivers/ptp/{ => emulated}/ptp_kvm_x86.c | 0 drivers/ptp/{ => emulated}/ptp_s390.c | 0 drivers/ptp/{ => emulated}/ptp_vmclock.c | 0 drivers/ptp/{ => emulated}/ptp_vmw.c | 0 drivers/ptp/ieee1588/Kconfig | 179 +++++++++++++ drivers/ptp/ieee1588/Makefile | 16 ++ drivers/ptp/{ => ieee1588}/ptp_clockmatrix.c | 0 drivers/ptp/{ => ieee1588}/ptp_clockmatrix.h | 0 drivers/ptp/{ => ieee1588}/ptp_dfl_tod.c | 0 drivers/ptp/{ => ieee1588}/ptp_dte.c | 0 drivers/ptp/{ => ieee1588}/ptp_fc3.c | 0 drivers/ptp/{ => ieee1588}/ptp_fc3.h | 0 drivers/ptp/{ => ieee1588}/ptp_idt82p33.c | 0Quoted 8 lines
drivers/ptp/{ => ieee1588}/ptp_idt82p33.h | 0 drivers/ptp/{ => ieee1588}/ptp_ines.c | 0 drivers/ptp/{ => ieee1588}/ptp_mock.c | 0 drivers/ptp/{ => ieee1588}/ptp_netc.c | 0 drivers/ptp/{ => ieee1588}/ptp_ocp.c | 0 drivers/ptp/{ => ieee1588}/ptp_pch.c | 0 drivers/ptp/{ => ieee1588}/ptp_qoriq.c | 0 26 files changed, 296 insertions(+), 253 deletions(-)
Quoted 5 lines
emulated sounds good but the ieee1588 doesn't sit well with me. IEEE1588 doesn't describe tickers and external signals. Let's leave them in the main directory? Or call it hw even if it's not 100% accurate? In
MAINTAINERSyou can exclude subdir with X:
Thanks for the suggestion. Leaving the network-oriented drivers in the main directory and using X: in MAINTAINERS to exclude the emulated ones makes sense to me. The layout will be adjusted in the next version.
Re: [PATCH 2/2] MAINTAINERS: update PTP maintainer entries after directory split
In reply to Jakub KicinskiQuoted 10 lines · Jakub Kicinski
MAINTAINERS W: http://linuxptp.sourceforge.net/ · line 21255
Quoted 5 lines · On Wed, 18 Mar 2026 15:33:30 +0800 Wen Gu wrote:
MAINTAINERS +5
-0+PTP EMULATED CLOCK SUPPORT +M: Wen Gu <[email protected]> +M: Xuan Zhuo <[email protected]> +L: [email protected] +S: MaintainedI thought David W was supposed to be the main maintainer? Two moderately known developers from a single vendor/company is not enough to delegate this IMO.
Thanks for pointing this out.
We would also very much prefer for this area to be maintained by people with deeper expertise in the clock/timekeeping domain (such as David). The reason David was not listed in this version is that an earlier attempt to ask about maintainership did not receive a reply[1]. So we avoided adding without confirmation.
If David has no objections to being listed here, that would definitely be preferable from our perspective. Other suggested clock/timekeeping experts would also be very welcome.
David Woodhouse
maintainerRe: [PATCH 2/2] MAINTAINERS: update PTP maintainer entries after directory split
Quoted 23 lines · Wen Gu
Quoted 10 lines · Jakub Kicinski
MAINTAINERS W: http://linuxptp.sourceforge.net/ · line 21255
Quoted 5 lines · On Wed, 18 Mar 2026 15:33:30 +0800 Wen Gu wrote:
MAINTAINERS +5
-0+PTP EMULATED CLOCK SUPPORT +M: Wen Gu <[email protected]> +M: Xuan Zhuo <[email protected]> +L: [email protected] +S: MaintainedI thought David W was supposed to be the main maintainer? Two moderately known developers from a single vendor/company is not enough to delegate this IMO.
Thanks for pointing this out.
We would also very much prefer for this area to be maintained by people with deeper expertise in the clock/timekeeping domain (such as David). The reason David was not listed in this version is that an earlier attempt to ask about maintainership did not receive a reply[1]. So we avoided adding without confirmation.
Quoted 6 lines
If David has no objections to being listed here, that would definitely be preferable from our perspective. Other suggested clock/timekeeping experts would also be very welcome.
Apologies for missing that; yes I'm perfectly happy to be listed as a maintainer. Thanks for checking.
Still mildly uncomfortable with 'emulated' as the word we chose for the non-ieee1588 clocks, although there's only so much bikeshedding we can do and it's ultimately cosmetic.
I see it more as precision RTCs which provide accurate CLOCK_REALTIME (ideally including UTC not just TAI) — largely to virtual guests but also on bare metal.
But as long as that's just a nitpick about what the directory is called, and not an ongoing disagreement about which drivers land where, I guess it doesn't matter much?
I don't actually want to see many new drivers added here. Going back to what someone (Jakub?) said in a thread a while back about a pile of cloud vendors' NIH cruft... I built the vmclock specification deliberately to be vendor-agnostic and (I think) even implementable in hardware with PCIe PTM, and I hope that we can consolidate on that and stop inventing new crap.
https://uapi-group.org/specifications/specs/vmclock/
The next thing I want to do is make the kernel's timekeeping sync from that as a proper feed-forward clock based on counter readings, instead of the feedback adjustment that the current NTP hooks permit. And make it possible to *export* the host's CLOCK_REALTIME to guests in vmclock form.