Skip to content

Unlock new potential in SJA1105 with PTP system timestamping

Vladimir Oltean netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: dsa: sja1105: Implement the .gettimex64 system call for PTPdrivers/net/dsa/sja1105/sja1105.h drivers/net/dsa/sja1105/sja1105_main.c drivers/net/dsa/sja1105/sja1105_ptp.c +1 more+61 -220 replies
2/3net: dsa: sja1105: Restore PTP time after switch resetdrivers/net/dsa/sja1105/sja1105_main.c drivers/net/dsa/sja1105/sja1105_ptp.c drivers/net/dsa/sja1105/sja1105_ptp.h +1 more+114 -320 replies
3/3net: dsa: sja1105: Disallow management xmit during switch resetdrivers/net/dsa/sja1105/sja1105_main.c+4 -00 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchRichard Cochran
SeriesA-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/3] Unlock new potential in SJA1105 with PTP system timestamping

The SJA1105 being an automotive switch means it is designed to live in a set-and-forget environment, far from the configure-at-runtime nature of Linux. Frequently resetting the switch to change its static config means it loses track of its PTP time, which is not good.

This patch series implements PTP system timestamping for this switch (using the API introduced for SPI here:
https://www.mail-archive.com/[email protected]/msg316725.html),
adding the following benefits to the driver:
- When under control of a user space PTP servo loop (ptp4l, phc2sys), the loss of sync during a switch reset is much more manageable, and the switch still remains in the s2 (locked servo) state.
- When synchronizing the switch using the software technique (based on reading clock A and writing the value to clock B, as opposed to relying on hardware timestamping), e.g. by using phc2sys, the sync accuracy is vastly improved due to the fact that the actual switch PTP time can now be more precisely correlated with something of better precision (CLOCK_REALTIME). The issue is that SPI transfers are inherently bad for measuring time with low jitter, but the newly introduced API aims to alleviate that issue somewhat.

This series is also a requirement for a future patch set that adds full time-aware scheduling offload support for the switch.

Vladimir Oltean (3):
net: dsa: sja1105: Implement the .gettimex64 system call for PTP
net: dsa: sja1105: Restore PTP time after switch reset
net: dsa: sja1105: Disallow management xmit during switch reset

 drivers/net/dsa/sja1105/sja1105.h      |   6 +-
 drivers/net/dsa/sja1105/sja1105_main.c |  42 +++++++++-
 drivers/net/dsa/sja1105/sja1105_ptp.c  | 103 ++++++++++++++++++-------
 drivers/net/dsa/sja1105/sja1105_ptp.h  |  24 +++++-
 drivers/net/dsa/sja1105/sja1105_spi.c  |  54 +++++++++----
 5 files changed, 177 insertions(+), 52 deletions(-)
Signature · 1 line
2.17.1