[PATCH net v2 0/2] ptp: make virtual clock sampling and teardown failure-safe

From: James Hilliard

Date: Mon Oct 05 2026 - 14:46:15 EST


Keep virtual clock state intact when a physical clock cannot be sampled,
and retain elapsed time when errors postpone the next successful sample.
Drain virtual clock sysfs changes before parent teardown so failed
creation requests can safely unwind their newly registered children.

Assisted-by: Codex:gpt-6-astra

---
Changes in v2:
- Drain virtual clock sysfs changes before parent unregister walks children.
- Use full-width samples and overflow-safe scaling across long sampling gaps.
- Update the anchor for extended and cross-timestamp reads under the clock lock.
- Link to v1: https://patch.msgid.link/20260930-ptp-vclock-sampling-v1-1-c11bc16691ae@xxxxxxxxx

To: Richard Cochran <richardcochran@xxxxxxxxx>
To: Andrew Lunn <andrew+netdev@xxxxxxx>
To: "David S. Miller" <davem@xxxxxxxxxxxxx>
To: Eric Dumazet <edumazet@xxxxxxxxxx>
To: Jakub Kicinski <kuba@xxxxxxxxxx>
To: Paolo Abeni <pabeni@xxxxxxxxxx>
To: Yangbo Lu <yangbo.lu@xxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx

---
James Hilliard (2):
ptp: drain virtual clock sysfs operations before unregistering children
ptp: vclock: preserve time across failed physical clock samples

drivers/ptp/ptp_clock.c | 5 ++
drivers/ptp/ptp_private.h | 10 ++--
drivers/ptp/ptp_sysfs.c | 14 ++++-
drivers/ptp/ptp_vclock.c | 148 ++++++++++++++++++++++++++++++----------------
4 files changed, 121 insertions(+), 56 deletions(-)
---
base-commit: aaaaf87ea99b8766c9a8aa0e71aa42e6bc8a5320
change-id: 20260930-ptp-vclock-sampling-902f98408c93

Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>