[PATCH net-next 0/3] net: stmmac: Add support for coarse timestamping

Kory Maincent kory.maincent at bootlin.com
Wed Oct 15 05:55:19 PDT 2025


On Wed, 15 Oct 2025 12:27:20 +0200
Maxime Chevallier <maxime.chevallier at bootlin.com> wrote:

> Hello everyone,
> 
> This is another attempt to support the fine vs coarse timestamping modes
> in stmmac.
> 
> This mode allows trading off PTP clock frequency adjustment precision
> versus timestamping precision.
> 
> In coarse mode, we lose the ability to fine-tune the PTP clock
> frequency, but get better timestamping precision instead. This is
> especially useful when acting as a PTP Grand Master, where the PTP clock
> in sync'd to a high-precision GPS clock through PPS inputs.
> 
> This has been submitted before as a dedicated ioctl() back in 2020 [1].
> Since then, we now have a better representation of timestamp providers
> with a dedicated qualifier (approx vs precise).
> 
> This series attempts to map these new qualifiers to stmmac's
> timestamping modes, see patch 2 for details.
> 
> The main drawback IMO is that the qualifiers don't map very well to our
> timestamping modes, as the "approx" qualifier actually maps to stmmac's
> "coars" mode, but we actually gain in timestamping precision (while
> losing frequency precision).

https://elixir.bootlin.com/linux/v6.17.1/source/include/uapi/linux/net_tstamp.h#L16
"approx" was initially added for DMA timestamp point.
Maybe we should add a new enum value here with a more suitable name.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com



More information about the linux-arm-kernel mailing list