Re: [PATCH net-next] ptp: add vclock timestamp conversion IOCTL

From: Richard Cochran
Date: Tue Oct 12 2021 - 12:14:18 EST


On Mon, Oct 11, 2021 at 05:58:15AM -0700, Richard Cochran wrote:
> On Fri, Oct 08, 2021 at 09:13:58AM +0200, Sebastien Laveze wrote:
> > Of course, so what tests and measurements can we bring on the table to
> > convince you that it doesn't lead to chaos ?

> - However, this particular physical clock uses a RMW pattern to
> program the offset correction.
>
> - Boom. Now the duration of the RMW becomes an offset error in the
> virtual clock. The magnitude may be microseconds or even
> milliseconds for devices behind slow MDIO buses, for example.

Come to think of it, even just calling clock_settime() on the physical
clock will cause trouble for the virtual clocks, and that on all
drivers.

The code would have to call gettime and figure the difference to the
new settime value, then apply the difference to the virtual clocks. I
expect that that would cause a phase error in the microseconds for
PCIe devices.

Thanks,
Richard