Hi Joseph,

On Mon, May 24, 2021 at 03:21:14PM -0700, Jacob Keller wrote:
> On 5/24/2021 2:06 AM, Joseph Matan wrote:
> > The kernel version I'm using (v4.19) doesn't support the gettimex
> > implementation, so I've added this patch:
> > More accurate PHC<->system clock synchronization
> > <https://patchwork.ozlabs.org/project/netdev/cover/20181109101449.15398-1-mlich...@redhat.com/>
> >  (I
> > only took patches 1-4/8)
> > But this patch doesn't include my KSZ driver (patches 5-8/8 include only
> > other drivers), so I had to add my own implementation to the KSZ driver
> > in order to support the PTP_SYS_OFFSET_EXTENDED ioctl.
> > Unfortunately, it didn't help, and I still suffer from huge delays and
> > offsets (I did verify the ptp4l is running the SYSOFF_METHOD method).
> >
> > Any other ideas or tips ?
> >
> > Thanks for the help,
> > Joseph
>
> Unfortunately no. That gettimex bits worked ok for Intel hardware
> because we have to read 2 (or 3) registers, and the time is locked by
> reading the lowest register. By using system time captures around that
> low register read we get a more accurate comparison.
>
> Unfortunately if this doesn't help your case, I am not sure what else
> would be worth trying.
>
> One possibility is to attempt to tune the servo parameters (The P and I
> constant values for the PI servo, for example). You might be able to
> find slightly better values that are less sensitive to the delay. It is
> likely this would take longer to converge but could produce a more
> smooth result at the end.
>
> You might also try one of the other servo algorithms such as linreg.
>
> Unfortunately if reading the clock time of your device has high jitter
> it will produce worse results. There's not much way around that.

Some ideas on how MDIO accesses can be made faster and more predictable:
disable transmission of preamble, increase frequency, use polled I/O
for the MDIO controller (you probably already do, unless you use i.MX
devices which are the only ones handling interrupts in mdio_read/write).
Additionally, if you have some time to spend with the mainline Linux
kernel, you can pick up and resubmit some patches that propagate struct
ptp_system_timestamp into the MDIO controller and allow software
timestamps to be one order of magnitude more precise.
Some more details and links here:
https://github.com/openil/linuxptp/issues/5#issuecomment-615979496


_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to