From: James Hilliard <james.hilliard1@gmail.com>
To: netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Jakub Kicinski <kuba@kernel.org>,
Richard Cochran <richardcochran@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Yangbo Lu <yangbo.lu@nxp.com>,
Miroslav Lichvar <mlichvar@redhat.com>
Cc: Eric Dumazet <edumazet@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
James Hilliard <james.hilliard1@gmail.com>
Subject: [PATCH net v6 0/5] ptp: make virtual clock sampling and teardown failure-safe
Date: Mon, 26 Oct 2026 12:11:26 -0600 [thread overview]
Message-ID: <20261026-ptp-vclock-sampling-v6-0-e705612541f1@gmail.com> (raw)
Fix virtual-clock sampling errors, registration rollback and parent
teardown in separate patches. Keep failed PHC reads out of the timecounter
and serialize extended samples with virtual-clock adjustments. Also
preserve the zero sentinel for packets without hardware timestamps.
Retain the existing cyclecounter mask, scaling and conversion windows.
Retry the first failed refresh promptly, then back off consecutive failures
while preserving regular two-second refresh attempts. Queue the first
refresh immediately after registration. Prolonged sampling gaps remain
subject to the existing half-wrap conversion window and full-wrap sampling
limit.
Changes in v6:
- Limit retry delays to the next regular refresh deadline so exponential
backoff cannot skip that attempt and lose a counter wrap after the parent
has recovered. Keep the backoff across deadlines to limit repeated work
during sustained failures.
- Report: https://lore.kernel.org/r/179303002839.3134.5595255852218546734@kernel.org
- Rebase onto current net.
- Link to v5: https://patch.msgid.link/20261022-ptp-vclock-sampling-v5-0-06ceace17bac@gmail.com
Changes in v5:
- Replace the fixed 10 ms failure retry with per-clock exponential backoff,
starting at 10 ms and capped at the normal two-second interval. Reset
the retry state after a successful refresh, following Sashiko's report
and Paolo Abeni's review.
- Report: https://lore.kernel.org/r/179245576913.3135.17393378308394380121@kernel.org
- Rebase onto current net.
- Link to v4: https://patch.msgid.link/20261015-ptp-vclock-sampling-v4-0-cba6ffc8ceb6@gmail.com
Changes in v4:
- Retry failed refreshes after 10 ms, keeping the normal two-second
interval after success.
- Queue the first refresh immediately after registration, while keeping
counter initialization before publication.
- Clarify the half-wrap conversion window and full-wrap sampling limit.
- Document the zero-input return from ptp_convert_timestamp().
- Add Vadim Fedorenko's Reviewed-by tags to patches 1 and 5.
- Rebase onto current net.
- Link to v3: https://patch.msgid.link/20261013-ptp-vclock-sampling-v3-0-d3ee4ea62fc6@gmail.com
Changes in v3:
- Split the independent fixes into separate patches, as requested by Paolo.
- Retain the existing timecounter arithmetic and conversion windows; drop
the full-width rewrite and extended-read anchor updates from v2.
- Propagate registration errors through sysfs, including a failed initial
PHC sample, and initialize the counter before publishing the clock.
- Preserve absent hardware timestamps instead of converting zero.
- Correct the sysfs teardown rationale and its Fixes tag.
- Rebase onto current net.
- Link to v2: https://patch.msgid.link/20261005-ptp-vclock-sampling-v2-0-8ed12d4d10af@gmail.com
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@gmail.com
Assisted-by: Codex:gpt-6-astra
---
James Hilliard (5):
ptp: drain virtual clock sysfs operations before unregistering children
ptp: unwind partially completed virtual clock creation
ptp: vclock: propagate physical clock sampling errors
ptp: vclock: serialize extended samples with counter updates
ptp: vclock: preserve missing hardware timestamps
drivers/ptp/ptp_clock.c | 5 ++
drivers/ptp/ptp_private.h | 7 ++-
drivers/ptp/ptp_sysfs.c | 18 +++++-
drivers/ptp/ptp_vclock.c | 123 ++++++++++++++++++++++++++-------------
include/linux/ptp_clock_kernel.h | 2 +-
5 files changed, 112 insertions(+), 43 deletions(-)
---
base-commit: 6430fb7f1cc4e329e386521b7b208df443de92f2
change-id: 20260930-ptp-vclock-sampling-902f98408c93
Best regards,
--
James Hilliard <james.hilliard1@gmail.com>
next reply other threads:[~2026-10-26 18:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 18:11 James Hilliard [this message]
2026-10-26 18:11 ` [PATCH net v6 1/5] ptp: drain virtual clock sysfs operations before unregistering children James Hilliard
2026-10-26 18:11 ` [PATCH net v6 2/5] ptp: unwind partially completed virtual clock creation James Hilliard
2026-10-26 18:11 ` [PATCH net v6 3/5] ptp: vclock: propagate physical clock sampling errors James Hilliard
2026-10-26 18:11 ` [PATCH net v6 4/5] ptp: vclock: serialize extended samples with counter updates James Hilliard
2026-10-26 18:11 ` [PATCH net v6 5/5] ptp: vclock: preserve missing hardware timestamps James Hilliard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261026-ptp-vclock-sampling-v6-0-e705612541f1@gmail.com \
--to=james.hilliard1@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlichvar@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=vadim.fedorenko@linux.dev \
--cc=yangbo.lu@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®