Am 2023-02-28 17:58, schrieb Russell King (Oracle):
On Tue, Feb 28, 2023 at 05:44:35PM +0100, Michael Walle wrote:
quoted
quoted
quoted
4. Letting drivers override PHY at run time.
I think this is the only sensible solution - we know for example that
mvpp2 will prefer its PTP implementation as it is (a) higher resolution
and (b) has more flexibility than what can be provided by the Marvell
PHYs that it is often used with.
Please also consider that there might be one switch with a shared
PHC and multiple PHYs, each with its own PHC.
Doesn't the PTP API already allow that? The PHC is a separate API from
the network hardware timestamping - and the netdev/PHY is required
to implement the ethtool get_ts_info API that provides userspace with
the index to the PHC associated with the interface.
Yes, but the source for the timestamp is the PHC. If the PHCs are
not synchronized, the timestamps won't be either. With a shared PHC,
the synchronization is already a given.
quoted
In this case, it is a
property of the board wether PHY timestamping actually works, because
it will need some kind of synchronization between all the PHYs.
How is this any different from e.g. a platform where there are
multiple network interfaces each with their own independent PHC
such as Macchiatobin, where there are two CP110 dies, each with
their own group of three ethernet adapters, and each die has its
own PHC shared between the three ethernet adapters?
Hardware synchronisation between the two PHCs isn't possible, but
they might tick at the same rate (it's something that hasn't been
checked.) However, the hardware signals aren't that helpful because
there's no way to make e.g. the rising edge always be at the start
of a second. So the synchronisation has to be done in software.
I don't think PHCs need to be synchronised in hardware to "actually
work". Take an example of a PC with two network cards, both having
their own independent PHC.
That might be true if you just want to use PTP as a time sync protocol,
but keep in mind that there is also the time aware scheduler which uses
the PHC as its time source, too. If you want to use PHY timestamping
in this case, the PHCs needs to be synchronized. Honestly, I'm not really
sure, how that is supposed to work.
All I'm trying to say, is there might also be some board constraints so
the MAC driver might not always be telling what is best, PHY or MAC.
-michael