Re: [RFC PATCH v2 0/2] AT8031 PHY timestamping support

From: Richard Cochran
Date: Fri Feb 28 2020 - 13:15:14 EST


On Fri, Feb 28, 2020 at 07:02:24PM +0100, Michael Walle wrote:
> (1) The PHY doesn't support atomic reading of the (timestamp,
> messageType, sequenceId) tuple. The workaround is to read the
> timestamp again and check if it has changed. Actually, you'd have
> to read the complete tuple again.

This HW is broken by design :(

> But if you're using a P2P clock with peer delay requests this whole
> thing falls apart because of caveat (3). You'll often see messages like
> received SYNC without timestamp
> or
> received PDELAY_RESP without timestamp
> in linuxptp. Sometimes it working for some time and then it starts to
> loosing packets. I suspect this depends on how the PDELAY messages are
> interleaved with the SYNC message. If there is not enough time to until
> the next event message is received either of these two messages won't
> have a timestamp.

And even the case where a Sync and a DelayResp arrive at nearly the
same time will fail.

> The PHY also supports appending the timestamp to the actual ethernet frame,
> but this seems to only work when the PHY is connected via RGMII. I've never
> get it to work with a SGMII connection.

This is the way to go. I would try to get the vendor's help in making
this work.

Thanks,
Richard