Discussion:
[Linuxptp-users] time synchronization issue
Rayagond Kokatanur
2016-02-09 07:04:05 UTC
Permalink
Hi All,

I am facing an issue where SLAVE system time is off by around 25-30sec
wrt MASTER system time.

Following is test setup,

a. I have connected two DUT's back to back which supports HARDWARE timestamping.
b. Changed the date and time on both the side and
c. Ran ptp4l command (ptp4l -i eth0 -p /dev/ptp0 -m) on both sides.

After ptp4l command, one DUT becomes SLAVE and other becomes
GRANDMASTER. Both are able to exchange the ptp messages.

I am able to verify that SLAVE PHC is getting synchronized to
GRANDMASTER PHC. I also verified that there is no difference between
MASTER PHC and MASTER system time,.

d. But when I run phc2sys (phc2sys -s /dev/ptp0 -w) on SLAVE side, I
could see that SLAVE system time is behind MASTER system time by
25-30sec.

Is this issue due to phcsys command ? or anything related to driver.

Please lets me know if any other points should be verified. Any other
pointers in resolving the issue would be appreciated.

Thanks and Regards,
Rayagond
Richard Cochran
2016-02-09 08:05:35 UTC
Permalink
Post by Rayagond Kokatanur
I also verified that there is no difference between
MASTER PHC and MASTER system time,.
There should be a difference. Your master's system time is in the UTC
timescale, but your master's PHC time is in the TAI timescale.

Are you using phc2sys on the master side? If so, how?

Thanks,
Richard
Rayagond Kokatanur
2016-02-09 08:43:50 UTC
Permalink
Post by Richard Cochran
Post by Rayagond Kokatanur
I also verified that there is no difference between
MASTER PHC and MASTER system time,.
There should be a difference. Your master's system time is in the UTC
timescale, but your master's PHC time is in the TAI timescale.
Oh, is it expected behavior ?

Is there any option to run both the clock on either UTC/TAI timescale ?
Post by Richard Cochran
Are you using phc2sys on the master side? If so, how?
No, I am not running phc2sys on MASTER. But if I run phy2sys on master
side (phy2sys -s /dev/ptp0 -w), then,

a. Both MASTER and SLAVE system time will synchronize but I am seeing
same 25-30sec difference between PHC and SYSTEM time on both MASTER
and SLAVE.

b. Both MASTER and SLAVE PHC are in sync.


Thanks,
Rayagond
Post by Richard Cochran
Thanks,
Richard
Richard Cochran
2016-02-09 22:47:36 UTC
Permalink
Post by Rayagond Kokatanur
Is there any option to run both the clock on either UTC/TAI timescale ?
For SW time stamping, there is no PHC, and thus we use UTC.
For HW time stamping (PHC), there is no reason at all to use UTC.

If a ptp4l node with a PHC becomes slave to a UTC master, then it
applies the correction automatically.
Post by Rayagond Kokatanur
No, I am not running phc2sys on MASTER. But if I run phy2sys on master
side (phy2sys -s /dev/ptp0 -w), then,
Try it like this on the master:

phc2sys -a -r -r

Note the two 'r' flags. And on the slave:

phc2sys -a -r

See also the phc2sys man page.

Thanks,
Richard

Continue reading on narkive:
Loading...