Skip to content

ptp: serialize requests and stop active EXTTS

Ahmad Byagowi netdev 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest2 patches 0 repliesNew
  2. v62 patches 1 replySuperseded
  3. v58 patches 2 repliesSuperseded

Changes in v7 from the cover letter

- Use the commit establishing the enable callback locking contract for the sysfs Fixes tag. Clarify unchanged error handling.
- Replace the blanket disable loop with tracked channel cleanup. Do not call into drivers for idle, unassigned channels.
- Keep the existing OCP detach and shared-PPS logic untouched.
- Align the author name and coalesce the commit trailers.

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ptp: serialize sysfs enable requests with ioctl pathsdrivers/ptp/ptp_sysfs.c+9 -00 replies
2/2ptp: shut down enabled unassigned EXTTS channels on unregisterdrivers/ptp/ptp_chardev.c drivers/ptp/ptp_clock.c drivers/ptp/ptp_private.h +1 more+61 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [PATCH net v7 0/2] ptp: serialize requests and stop active EXTTS

This series is limited to the PTP/PHC core. No driver change is needed to apply it.

The sysfs enable callbacks take pincfg_mux, as the ioctl callbacks already do. The core tracks successfully enabled timestamp channels under that mutex, including requests without a pin assignment. On unregister, after the user interfaces have been removed, it disables tracked channels and preserves existing cleanup for assigned pins. The tracked channel indices go directly to EXTTS requests, without changing pin assignments. PPS is disabled last, before source release.

Changes since v6:
- Use the commit establishing the enable callback locking contract for the sysfs Fixes tag. Clarify unchanged error handling.
- Replace the blanket disable loop with tracked channel cleanup. Do not call into drivers for idle, unassigned channels.
- Keep the existing OCP detach and shared-PPS logic untouched.
- Align the author name and coalesce the commit trailers.

Validation (local fixtures, not included in the patches): strict PTP object builds on x86_64 and i386, allmodconfig and allyesconfig. Source-derived tests model teardown, last-subscriber IRQ draining, idle, failed and already-disabled requests, and unassigned channels. The host fixture uses stubbed register and interrupt operations. Nine local KUnit cases pass in QEMU with KASAN, lockdep and DEBUG_ATOMIC_SLEEP, using real PTP unregister and sysfs callbacks with a test clock.
No physical card or switch test was performed.

Coding-assistant support was used to review callback and teardown paths, develop fixes and local test cases, and prepare changelogs.

v6: https://lore.kernel.org/r/[email protected]/
Review: https://lore.kernel.org/r/[email protected]

Ahmad Byagowi (2):
ptp: serialize sysfs enable requests with ioctl paths
ptp: shut down enabled unassigned EXTTS channels on unregister