hi,

phc2sys has 3 phases
1) unlock (s0, SERVO_UNLOCKED 
2) time-sync (s1, SERVO_JUMP)
3) freq-sync (s2, SERVO_LOCKED)

Based on the log capture below:
Nov 10 03:49:05 phc2sys: [21956.824] CLOCK_REALTIME phc offset         8 s2 
freq   +9775 delay   2252
Nov  4 12:50:40 ptp4l: [21957.406] rms    3 max    5 freq  +2780 +/-   5 delay  
  86 +/-   1
Nov  6 05:55:10 phc2sys: [21957.824] clockcheck: clock jumped backward or 
running slower than expected!
Nov  6 05:55:10 phc2sys: [21957.824] CLOCK_REALTIME phc offset -338035766568736 
s0 freq   +9775 delay   2461
Nov  6 07:39:56 ptp4l: [21958.399] rms    2 max    3 freq  +2783 +/-   3 delay  
  85 +/-   1
Nov  9 21:52:19 phc2sys: [21958.824] CLOCK_REALTIME phc offset -21408060435248 
s0 freq   +9775 delay   2468
Nov  9 21:52:19 ptp4l: [21959.393] rms    3 max    6 freq  +2784 +/-   4 delay  
  84 +/-   1
Nov  9 21:52:20 phc2sys: [21959.825] CLOCK_REALTIME phc offset -21408060435245 
s2 freq   +9772 delay   2472

Actual time as received by ptp4l from GM is Nov 10 03:49 (1636516145) But 
system time is somehow got changed to Nov 9 21:52 (1636494740)

Offset between two (ptp4l and system time) is 21408 seconds.

So when the phc2sys moves from s0 to s2 via s1 phase, it should have set the 
system time to proper value based on below code (clockadj_step).
        case SERVO_JUMP:
                clockadj_step(clock->clkid, -offset);
                if (clock->sanity_check)
                        clockcheck_step(clock->sanity_check, -offset);
                /* Fall through. */
        case SERVO_LOCKED:

But it still remained on Nov 9 21:52. What is wrong here?
Nov  9 21:52:20  ptp4l: [21960.382] rms    3 max    6 freq  +2776 +/-   2 delay 
   86 +/-   1
Nov  9 21:52:21 phc2sys: [21960.825] CLOCK_REALTIME phc offset -21408060435252 
s2 freq -100000000 delay   2488
Nov  9 21:52:21 ptp4l: [21961.429] rms    3 max    6 freq  +2778 +/-   5 delay  
  86 +/-   0
Nov  9 21:52:22 phc2sys: [21961.825] CLOCK_REALTIME phc offset -21407969493862 
s2 freq -100000000 delay   2709
Nov  9 21:52:22 ptp4l: [21962.520] rms    3 max    7 freq  +2784 +/-   4 delay  
  85 +/-   1

Please suggest.

regards,
Ramesh


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

Reply via email to