mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net: macb: Rework hardware timestamp configuration
@ 2026-09-22  9:10 Kim Wooseok via B4 Relay
  2026-09-22  9:10 ` [PATCH net-next 1/4] net: macb: Preserve timestamp settings on rejected requests Kim Wooseok via B4 Relay
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Kim Wooseok via B4 Relay @ 2026-09-22  9:10 UTC (permalink / raw)
  To: netdev, Théo Lebrun, Rafal Ozieblo
  Cc: Conor Dooley, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Nicolai Buchwitz,
	linux-kernel, Kim Wooseok

This started with two problems I found while using PTP hardware
timestamping on a Raspberry Pi 5. A rejected RX filter could still
change the TX one-step setting, and the PTPv1 Sync and Delay_Req filters
returned success without enabling RX timestamps.

This series reworks gem_set_hwtst() to validate the whole request before
programming the hardware. It calculates the settings locally, then
updates the registers and saved configuration under bp->lock. With the
register writes now in the setter, the two helpers are no longer needed.

The remaining patches use the existing ALL fallback for the specific
PTPv1 filters, turn off one-step mode for TX_OFF, and clear SRTSM when
switching away from a PTPv2 filter. Each change is kept in its own patch.

I compared the old and new behavior on the Pi 5. When I requested a TX
mode change together with an invalid RX filter, the patched driver
rejected the request without changing the saved settings or NCR. I
also switched from one-step TX and PTPv2 RX to other settings and back.
Only the relevant bits changed, and restoring the original settings
restored NCR.

For the PTPv1 filters, I checked the effect by sending Sync and Delay_Req
packets over Ethernet. Before the change, the packets arrived without
hardware timestamps. With the patches, the driver returned ALL and I
could read the hardware timestamps from the received packets. PTPv2
multicast reception continued to provide hardware timestamps, and
selecting NONE disabled timestamping. I ran these tests with the changes
backported to the Pi's existing Linux 6.18.46 RT kernel.

On net-next, I built the series with ARM64 allyesconfig and allmodconfig,
both with W=1. Sparse reported no diagnostics in macb_ptp.c.

Assisted-by: GPT-6 Astra
Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr>
---
Kim Wooseok (4):
      net: macb: Preserve timestamp settings on rejected requests
      net: macb: Enable RX timestamping for specific PTPv1 filters
      net: macb: Disable one-step mode when TX timestamping is off
      net: macb: Clear SRTSM outside PTPv2 receive filters

 drivers/net/ethernet/cadence/macb_ptp.c | 63 ++++++++++++---------------------
 1 file changed, 23 insertions(+), 40 deletions(-)
---
base-commit: 8830e65ed46de41f849eefb8ba227d4852c460f6
change-id: 20260922-codex-macb-hwtstamp-submit-25ab4a2e6b94

Best regards,
--  
Kim Wooseok <5mghybrid@khu.ac.kr>



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

end of thread, other threads:[~2026-09-22 19:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22  9:10 [PATCH net-next 0/4] net: macb: Rework hardware timestamp configuration Kim Wooseok via B4 Relay
2026-09-22  9:10 ` [PATCH net-next 1/4] net: macb: Preserve timestamp settings on rejected requests Kim Wooseok via B4 Relay
2026-09-22 10:47   ` Nicolai Buchwitz
2026-09-22 19:01   ` Théo Lebrun
2026-09-22 19:36     ` Théo Lebrun
2026-09-22  9:10 ` [PATCH net-next 2/4] net: macb: Enable RX timestamping for specific PTPv1 filters Kim Wooseok via B4 Relay
2026-09-22 10:47   ` Nicolai Buchwitz
2026-09-22 19:01   ` Théo Lebrun
2026-09-22  9:10 ` [PATCH net-next 3/4] net: macb: Disable one-step mode when TX timestamping is off Kim Wooseok via B4 Relay
2026-09-22 10:47   ` Nicolai Buchwitz
2026-09-22 19:15   ` Théo Lebrun
2026-09-22  9:10 ` [PATCH net-next 4/4] net: macb: Clear SRTSM outside PTPv2 receive filters Kim Wooseok via B4 Relay
2026-09-22 10:48   ` Nicolai Buchwitz
2026-09-22 19:27   ` Théo Lebrun
2026-09-22 11:15 ` [PATCH net-next 0/4] net: macb: Rework hardware timestamp configuration Nicolai Buchwitz

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®