net: lan743x: ptp: Fix simultaneous PEROUT on PCI11x1x
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net: lan743x: ptp: Add PCI11X1X_PTP_N_PEROUT and extend ptp_io_perout arraydrivers/ drivers/ | +7 | 0 replies | |
| 2/2 | net: lan743x: ptp: Fix PEROUT event channel assignment on PCI11x1xdrivers/ | +48 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH net 0/2] net: lan743x: ptp: Fix simultaneous PEROUT on PCI11x1x
The PCI11x1x hardware supports up to 12 PTP-IO pins as simultaneous periodic outputs, but the driver was limited to 2 due to two bugs:
1. ptp_io_perout[] was sized by LAN743X_PTP_N_PEROUT (2) and n_per_out was hardcoded to LAN743X_PTP_N_EVENT_CHAN (2), so any perout index above 1 was rejected immediately by the PTP core.
2. lan743x_ptp_reserve_event_ch() refused to assign a channel already in use, and lan743x_ptp_release_event_ch() unconditionally tore down the hardware channel on first release — both preventing multiple pins from sharing the same event channel.
Patch 1 introduces PCI11X1X_PTP_IO_MAX_OUT_PINS (12), resizes the arrays, and sets n_per_out conditionally for PCI11x1x devices.
Patch 2 fixes the channel assignment logic: maps perout indices to channels via index % 2, adds refcount-based sharing, and guards hardware teardown until the last user releases.
Thangaraj Samynathan (2):
net: lan743x: ptp: Add PCI11X1X_PTP_N_PEROUT and extend ptp_io_perout
array
net: lan743x: ptp: Fix PEROUT event channel assignment on PCI11x1x
drivers/net/ethernet/microchip/lan743x_ptp.c | 87 ++++++++++++-------- drivers/net/ethernet/microchip/lan743x_ptp.h | 5 +- 2 files changed, 55 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1