Hi Sebastian,

On Fri, Dec 21, 2018 at 10:18:19PM +0100, Sebastian Andrzej Siewior wrote:
> Both IMX systems have no RTC so the year after boot is in 1900.
> Usually the ptp synchronizes first and then ntp sets the current time.
> The problem is that after the "time jump" ptp does noch synchronize. If
> the ptp stack is started after ntpd set the time, then the time gets
> properly synchronized.
> Did I miss a config option or does ptp simply not support such a time
> jump?

There are two options, one for the first jump and one for subsequent
jumps.  In the configuration file these are:

       step_threshold
              The maximum offset the servo will correct by changing the  clock
              frequency  instead  of  stepping the clock. When set to 0.0, the
              servo will never step the clock except on start. It's  specified
              in  seconds.  The default is 0.0.  This option used to be called
              pi_offset_const.

       first_step_threshold
              The maximum offset the servo will correct by changing the  clock
              frequency instead of stepping the clock. This is only applied on
              the first update. It's specified in seconds. When  set  to  0.0,
              the servo won't step the clock on start.  The default is 0.00002
              (20 microseconds).  This option  used  to  be  called  pi_f_off‐
              set_const.

You should set step_threshold.

Since the time jump from ntpd will affect the whole chain of clocks,
you will need to set these for ptp4l and phc2sys on both devices.

In the case of phc2sys, recent version support configuration file
options, but for older versions you can use the command line options:

       -S step
              Specify  the step threshold of the servo. It is the maximum off‐
              set that the servo corrects  by  changing  the  clock  frequency
              instead  of  stepping  the  clock. The clock is stepped on start
              regardless of the  option  if  the  offset  is  larger  than  20
              microseconds  (unless  the -F option is used). It's specified in
              seconds. The value of 0.0 disables stepping after the start. The
              default is 0.0.

       -F step
              Specify  the step threshold applied only on the first update. It
              is the maximum offset that is corrected by  changing  the  clock
              frequency.  It's specified in seconds. The value of 0.0 disables
              stepping on start. The default is 0.00002 (20 microseconds).
 
> Another question: While fully synchronized I see this:
> 
> | ptp4l[9839.908]: master offset       -965 s2 freq    +478 path delay     
> 23865
> | ptp4l[9840.908]: master offset       -135 s2 freq   +1018 path delay     
> 23865
> | ptp4l[9841.908]: master offset        658 s2 freq   +1771 path delay     
> 23865
> | ptp4l[9842.913]: master offset        563 s2 freq   +1873 path delay     
> 23880
> | ptp4l[9843.910]: master offset       -289 s2 freq   +1190 path delay     
> 23929
> | ptp4l[9844.913]: master offset        -42 s2 freq   +1350 path delay     
> 23880
> | ptp4l[9846.080]: master offset       -541 s2 freq    +839 path delay     
> 23880
> | ptp4l[9846.913]: clockcheck: clock jumped forward or running faster than 
> expected!
> | ptp4l[9846.915]: master offset        403 s0 freq    +839 path delay     
> 23880
> | ptp4l[9846.915]: port 1: SLAVE to UNCALIBRATED on SYNCHRONIZATION_FAULT
> | ptp4l[9847.913]: master offset        374 s2 freq   +1188 path delay     
> 23880
> | ptp4l[9847.913]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
> | ptp4l[9848.910]: master offset        777 s2 freq   +1965 path delay     
> 23880
> | ptp4l[9849.910]: master offset        183 s2 freq   +1605 path delay     
> 23880
> | ptp4l[9850.910]: master offset       -448 s2 freq   +1028 path delay     
> 23876
> 
> Could someone please explain what this means?

The "clockcheck" is a sanity check that compares the PHC clock with
CLOCK_MONOTONIC.  If the frequency offset exceeds 20% then this
message is printed.  You can configure the threshold with:

       sanity_freq_limit
              The  maximum  allowed frequency offset between uncorrected clock
              and the system monotonic clock in parts per billion (ppb).  This
              is  used  as  a  sanity  check of the synchronized clock. When a
              larger offset is measured, a warning message will be printed and
              the servo will be reset. When set to 0, the sanity check is dis‐
              abled. The default is 200000000 (20%).

HTH,
Richard



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

Reply via email to