TLDR: It could also be the GM.

I see this on embedded networks, ie. the whole network including the GM is on the same power switch, it all comes up together, and none of the RTC's have battery backup.

Maybe the "GM" is just another embedded computer that gets time from GPS or something like that. So the "GM" starts serving time over PTP starting at the epoch, everything sync's to it, then the GM jumps when it gets GPS lock.

Alternately, the GM just takes longer to boot for whatever reason. So some random host is selected as master, serving the epoch over PTP, and all the other hosts sync to that. Then, when the GM starts serving the real time, the other hosts switch to it. But again, phc2sys has already sync'd to the wrong time.

- Ed

On 6/16/23 10:19, Nemo Crypto wrote:
Thank you Ed!
I am using -w option but not -S. I now understand why the clock step is not happening. But with -w phc2sys should start only after ptp4l, isn't it? If yes, then why would this happen - "the clock has jumped from the epoch after phc2sys started".

The only way is probably that "-w" option is not effective?


Thanks,
Nemo


On Friday, 16 June, 2023 at 09:33:23 am GMT-4, Ed Branch <bra...@arlut.utexas.edu> wrote:


You need either of:

1) a battery backup for the real-time clock so that it starts at a
reasonable time.
2) Use -w option to phc2sys so that it waits until ptp4l is synchronized.
3) Use the -S option to phc2sys so that it steps the clock if the offset
is above some threshold.

By default, phc2sys will step the clock only once at startup, but here
the clock has jumped from the epoch after phc2sys started. It would take
a very long time (530 years in this case) to adjust for that without
stepping the clock.

- Ed

On 6/15/23 19:06, Nemo Crypto wrote:
 > Hi LinuxPTPUsers,
 >
 > I have this weird problem sometimes with phc2syc. Please look at the log
 > below, ptp4l service is perfectly okay. But the phc2sys is stuck
 > (although it measures the offset correctly) and not adjusting the system
 > time for some reason. Why would this happen? Waiting for more than 30
 > minutes didn't fix this problem.
 >
 > Several reboots fixes the issue.
 >
> 1970-01-01T00:05:09.600718+00:00 phc2sys: [304.725] CLOCK_REALTIME phc offset -1686774497008453238 s2 freq -100000000 delay  1372
 >
> 1970-01-01T00:05:09.628181+00:00 ptp4l: [304.752] master offset   198 s3 freq  -35590 path delay      323
 >
> 1970-01-01T00:05:10.611304+00:00 phc2sys: [305.735] CLOCK_REALTIME phc offset -1686774496916583694 s2 freq -100000000 delay  1372
 >
> 1970-01-01T00:05:10.728644+00:00 ptp4l: [305.853] master offset   -63 s3 freq  -35792 path delay      323
 >
> 1970-01-01T00:05:11.618971+00:00 phc2sys: [306.743] CLOCK_REALTIME phc offset -1686774496824974153 s2 freq -100000000 delay  1373
 >
> 1970-01-01T00:05:11.829106+00:00 ptp4l: [306.953] master offset -121 s3 freq  -35869 path delay      323
 >
> 1970-01-01T00:05:12.717043+00:00 phc2sys: [307.841] CLOCK_REALTIME phc offset -1686774496725151408 s2 freq -100000000 delay  1408
 >
> 1970-01-01T00:05:12.929540+00:00 ptp4l: [308.054] master offset   111 s3 freq  -35673 path delay      323
 >
> 1970-01-01T00:05:13.721458+00:00 phc2sys: [308.846] CLOCK_REALTIME phc offset -1686774496633835940 s2 freq -100000000 delay  1373
 >
> 1970-01-01T00:05:14.030032+00:00 ptp4l: [309.154] master offset -112 s3 freq  -35863 path delay      323
 >
 >
 >
 > Thanks,
 > Nemo

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

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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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

Reply via email to