Discussion:
[Linuxptp-users] timemaster and phc2sys
FUSTE Emmanuel
2017-02-09 17:26:25 UTC
Permalink
Hello,

Why timemaster launch phc2sys with the "-r" option ?

It could be a complete misunderstanding of the doc/code on my side.
But as the goal is to pass the measurement to ntpd via the ntpshm pseudo
servo to let ntpd do the system clock adjustments and updates, "-r" is
irrelevant and will step on/conflict with ntpd time adjustments/updates.

Sorry for the noise if my reasoning is faulty/incomplete.

Emmanuel.
Miroslav Lichvar
2017-02-10 08:50:10 UTC
Permalink
Post by FUSTE Emmanuel
Hello,
Why timemaster launch phc2sys with the "-r" option ?
It could be a complete misunderstanding of the doc/code on my side.
But as the goal is to pass the measurement to ntpd via the ntpshm pseudo
servo to let ntpd do the system clock adjustments and updates, "-r" is
irrelevant and will step on/conflict with ntpd time adjustments/updates.
I can see why this could be confusing.

The -r option enables synchronization of the system clock to the PTP
clock, but phc2sys doesn't care which servo is selected. With the
ntpshm servo, it's another process controlling the clock instead of
phc2sys. If timemaster started phc2sys without -r, it wouldn't try to
synchronize the system clock and the ntpshm servo wouldn't write any
samples for ntpd.
--
Miroslav Lichvar
FUSTE Emmanuel
2017-02-10 11:48:01 UTC
Permalink
Post by Miroslav Lichvar
Post by FUSTE Emmanuel
Hello,
Why timemaster launch phc2sys with the "-r" option ?
It could be a complete misunderstanding of the doc/code on my side.
But as the goal is to pass the measurement to ntpd via the ntpshm pseudo
servo to let ntpd do the system clock adjustments and updates, "-r" is
irrelevant and will step on/conflict with ntpd time adjustments/updates.
I can see why this could be confusing.
The -r option enables synchronization of the system clock to the PTP
clock, but phc2sys doesn't care which servo is selected. With the
ntpshm servo, it's another process controlling the clock instead of
phc2sys. If timemaster started phc2sys without -r, it wouldn't try to
synchronize the system clock and the ntpshm servo wouldn't write any
samples for ntpd.
Ok, I dig deeper into the code and the magic is in the SERVO_UNLOCKED
and zero return from ntpshm_sample().
And CLOCK_REALTIME is still registered as it is the clock against we are
producing samples to be passed to ntpd/chrony.

Thank you !

Perhaps something like "With the ntpshm servo, system clock is not
directly updated but samples against it are produced to allow another
process to do it." Could be added after the second phrase of the "-r"
description in the doc/man page.

Emmanuel.

Loading...