Re: [PATCH RFC] igb: Use TAI clock to reset PHC value

From: Richard Cochran
Date: Fri Jun 30 2023 - 12:57:58 EST


On Fri, Jun 30, 2023 at 05:41:38PM +0200, Yoann Congal wrote:
> The PHC is usually synchronised in TAI (from PTP). By resetting it with
> the kernel TAI clock we avoid having to correct the PHC from REALTIME
> (usually UTC) to TAI (37s as of today).

Nothing guarantees that the kernel's time is correct.

When initializing a PHC, it is better to reset it to zero. That way,
the fact that the clock is unsynchronized is obvious. Otherwise,
people may believe the PHC is synchronized when in fact it is not.

> RFC: While this patch looks trivial and it does make linuxptp/ptp4l
> complain about a driver bug:
> timed out while polling for tx timestamp
> increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug
> port 1: send peer delay response failed
>
> Increasing tx_timestamp_timeout to 1s does nothing different so I guess
> the driver does indeed freeze with this change but I can't figure out
> why...
>
> Do you have any idea/pointers? Thanks!

No idea, but you should figure that out before posting a "fix".

Thanks,
Richard