Netdev List
 help / color / mirror / Atom feed
* [PATCH net v3 0/4] ptp: fix timestamp teardown and OCP DPLL routing
@ 2026-11-20 21:21 Ahmad Byagowi
  2026-11-20 21:21 ` [PATCH net v3 1/4] ptp: disable all timestamp channels after removing the user interfaces Ahmad Byagowi
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ahmad Byagowi @ 2026-11-20 21:21 UTC (permalink / raw)
  To: netdev
  Cc: andrew+netdev, arkadiusz.kubalewski, davem, edumazet, jiri, kuba,
	pabeni, richardcochran, rmk+kernel, vadim.fedorenko,
	vladimir.oltean

This revision keeps timestamp shutdown in PTP core, after removal of the
user interfaces, instead of adding a driver-specific stopping flag.

Patch 1 changes ptp_disable_all_events() to disable all advertised EXTTS
channels, not just channels recorded in pin descriptors. ptp_ocp has six
channels and four SMA descriptors; assigning artificial pins would change
the existing interface and cannot represent all enabled channels at once.
The patch removes ptp_ocp's early disable loop and ensures that an empty
shared PPS map still causes hardware disable and IRQ draining. The latter
also covers overlapping sysfs and ioctl requests before unregister.

This follows Vadim's agreement to fix PTP core cleanup in the discussion
linked below. It does not add pins or change normal SMA routing. The
existing PPS/EXTTS shortcut remains while another subscription is active.
Patch 1 does not claim a formal Reviewed-by or Acked-by for the new code.

Patches 2-4 are unchanged in code and carry Vadim's Reviewed-by tags.

Validation:
- 100 source-derived ASan/UBSan removal/shared-PPS runs, including the
  empty-map race, six timestamp channels and IRQ-drain ordering.
- Seven deliberate regressions rejected by runtime assertions.
- Five KUnit cases pass using real PTP register/unregister in QEMU with
  KASAN, lockdep and DEBUG_ATOMIC_SLEEP. All five fail on the old core.
  The test callback models event state; no physical IRQ source is used.
- DPLL/SMA source-derived tests pass.
- Complete drivers/ptp/ subtree builds pass for x86-64 and i386 with
  allmodconfig and allyesconfig, W=1 and KCFLAGS=-Werror.

No physical card was removed or tested. Other PTP hardware drivers have
not received runtime coverage from these tests.

Changes from v2:
- Replace the timestamp stopping flag and spinlock solution with core
  channel cleanup after the user interfaces are drained.
- Remove the preliminary OCP disable loop and drain an empty PPS map.
- Preserve the three review tags and keep the other code fixes unchanged.
- Refresh on current net; the PTP sources are unchanged by the rebase.
- The v2 80-column warning is gone with the removed spinlock code.
  Keep the replacement shared-PPS comment within 80 columns as well.

v2: https://lore.kernel.org/r/20261119-timecard-common-v2-078fe69f33-0-ahmadexp@gmail.com
Cleanup discussion: https://lore.kernel.org/r/75abd6c6-f0ee-4665-9451-05e0e1a7a3d7@linux.dev

This series replaces the earlier common fixes, rather than stacking on
them. The CI pending tree net-next-2026-11-20--00-00 still contains v1's
mutex implementation and the three routing fixes. That explains v2's
pending-tree apply conflict; those four old patches must be replaced.

The original common-driver issues were reported by the netdev Sashiko AI
review. Codex revised patch 1, its tests and the explanatory text from the
request to test Vadim's approach and preserve shared PPS behavior. The
unchanged patches retain their original provenance statements.

Ahmad Byagowi (4):
  ptp: disable all timestamp channels after removing the user interfaces
  ptp: ocp: use hardware selectors in DPLL frequency operations
  ptp: ocp: report disabled SMA inputs consistently over DPLL
  ptp: ocp: correct the DCF output frequency

 drivers/ptp/ptp_chardev.c |  8 +++-----
 drivers/ptp/ptp_ocp.c     | 25 ++++++++-----------------
 2 files changed, 11 insertions(+), 22 deletions(-)


base-commit: d7f2d9b6c7d0ff0af7d19d889810d35dfe07da90

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-22 20:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 21:21 [PATCH net v3 0/4] ptp: fix timestamp teardown and OCP DPLL routing Ahmad Byagowi
2026-11-20 21:21 ` [PATCH net v3 1/4] ptp: disable all timestamp channels after removing the user interfaces Ahmad Byagowi
2026-11-22 20:10   ` Vadim Fedorenko
2026-11-20 21:21 ` [PATCH net v3 2/4] ptp: ocp: use hardware selectors in DPLL frequency operations Ahmad Byagowi
2026-11-20 21:21 ` [PATCH net v3 3/4] ptp: ocp: report disabled SMA inputs consistently over DPLL Ahmad Byagowi
2026-11-20 21:21 ` [PATCH net v3 4/4] ptp: ocp: correct the DCF output frequency Ahmad Byagowi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox