On 1/22/2018 9:56 PM, Richard Cochran wrote:
On Mon, Jan 15, 2018 at 04:59:13PM +0000, Loy, Matthias wrote:
we are syncronizing devices using ptp. The absolute time is not
relevant but all devices should be close to each other.

Furthermore devices are connected and disconnected at any time and most
of the time there is no real grandmaster clock with higher priority.

As a result, a new connected device may became ptp grandmaster and all
others adjust there time.

If the new grandmaster is waaaay back in time, phc2sys refuses to set
the clock. I found the reason in the kernel and created a patch you can
find attached.

What do you think about that? For my understanding it would be okay to
step the realtime clock backwards even below 0 because the value
holding the sceonds is a signed int variable.
I doubt your patch would find acceptance on the lkml.  The check is a
sanity check that makes sense for most use cases.

You can work around this issue by setting some arbitrary date, like
1984, as part of your boot scripts.

Thanks,
Richard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! 
http://atpscan.global.hornetsecurity.com/index.php?atp_str=Xe-YjC9OASLZ0J6-KhBFV2LpYIC_NJr0MMTvDNq4058DtJ6eiEsHK9FWviDmAHe0FYADXT5opOuddfBv9ZTqUZup4VkEU5InRMKtVmOONsxd-SdDJOz8koLkDTPpLVFhsOtHdnMB3PkiB96m_9POZkUy2vnl7UCxmpGYhLXc0JkLGHB80Fr9zCWRtaoJU3AN7toG-rPI-fL0qNL1kE9U0r-M2UwPiAAG_0aejfFIw1HN19k4bsGtikQs5DoVsCedpQfQD8I9LoqyHgG4Xz-7Jhc_KkGBIjIqW4ShXsQUPH32lxYuIzo6IzFkZGFkZTMyYzFkNCM6OiM9qfMAzRxlmQkc0BE-WjLN
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

I'm not sure how that workaround fixes the issue.  As I understand it Mathias' issue is the following:

   Device A PTP synchronized to Device B (time is now)
   Device C comes on line and becomes PTP master (time is way in the past)
   Device A (and probably B) can not set their clocks due to the large
   negative jump.


Unless I'm missing something, without rebooting devices A and/or B, how does setting the time in the boot scripts for devices A and/or B fix this?

Mike
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to