I think Richard is correct.

The sync state depends on your system.
On my setting a 'sync' is when the correction is bellow 100 nanoseconds, when 
it is usually bellow 10 nanoseconds and I except to have it stable for 5 
seconds long.

There is no generic sync.

So each user need to define a 'sync' that match to its system needs.

Erez


-----Original Message-----
From: Miroslav Lichvar <mlich...@redhat.com> 
Sent: Thursday, 17 March 2022 08:52
To: Martin Pecka <pecka...@fel.cvut.cz>
Cc: linuxptp-devel@lists.sourceforge.net
Subject: Re: [Linuxptp-devel] [PATCH] Add non-portable management option to 
query the servo state (via SERVO_STATE_NP).

On Wed, Mar 16, 2022 at 11:55:27PM +0100, Martin Pecka wrote:
> > People naively want a simple Boolean flag.  However, the reality is 
> > that there is no simple answer to the question, is my computer 
> > synchronized.
> Well, that is actually what people expect from a time sync daemon. 
> Chrony has it (* or + in `chronyc sources`),

* or + only tells you whether a time source is selected for synchronization, 
nothing about the clock actually being synchronized, no matter what definition 
you have for that. It's a common misconception. In PTP that would be a port 
being in the slave state.

On systemd-based distributions there is a "time-sync" target, after which can 
be ordered start of services that require "synchronized"
clock. With the chrony-wait service, the time-sync target is reached when the 
reported remaining correction of the clock is less than 100 milliseconds.

With ptp4l or phc2sys, you would just wait for the first non-zero offset 
smaller than some value (e.g. 1000 nanoseconds).

> systemd has it ("System clock synchronized: yes" in timedatectl)

'yes' is reported by timedatectl when the maxerror value of the system clock 
(from adjtimex() or ntp_gettime()) is smaller than 16 seconds.
That normally happens on the first update of the clock. timedated/ctl doesn't 
know what is actually controlling the clock. This works even with ptp4l (if SW 
timestamping) and phc2sys.

--
Miroslav Lichvar



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flinuxptp-devel&amp;data=04%7C01%7Cerez.geva.ext%40siemens.com%7Cb56d74cf8ed34f330f8208da07eba198%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637831005855295321%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=%2BzjBaUTSdCiE%2BrRyKIjAfNuID%2Be8GTZcFtvtXiwDVzk%3D&amp;reserved=0


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

Reply via email to