The nullf servo can now enter the SERVO_LOCKED_STABLE state by transitioning first to the SERVO_LOCKED state when the offset is less than the set value for offset_threshold. If offset_threshold is not set, the SERVO_LOCKED state can be entered when the offset is less than or equal to the set value for step_threshold.
Signed-off-by: Rahul Rameshbabu <rrameshb...@nvidia.com> --- nullf.c | 9 ++++++--- phc2sys.8 | 12 ++++++------ ptp4l.8 | 14 +++++++------- ts2phc.8 | 8 ++++---- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/nullf.c b/nullf.c index 9a40d07..8228636 100644 --- a/nullf.c +++ b/nullf.c @@ -38,14 +38,17 @@ static double nullf_sample(struct servo *servo, int64_t offset, uint64_t local_ts, double weight, enum servo_state *state) { - if (!offset) { + long long int abs_offset = llabs(offset); + + if ((servo->offset_threshold && abs_offset < servo->offset_threshold) || + (servo->step_threshold && servo->step_threshold >= abs_offset)) { *state = SERVO_LOCKED; return 0.0; } if ((servo->first_update && servo->first_step_threshold && - servo->first_step_threshold < llabs(offset)) || - (servo->step_threshold && servo->step_threshold < llabs(offset))) { + servo->first_step_threshold < abs_offset) || + (servo->step_threshold && servo->step_threshold < abs_offset)) { *state = SERVO_JUMP; } else { *state = SERVO_UNLOCKED; diff --git a/phc2sys.8 b/phc2sys.8 index 6de2d25..b8f2224 100644 --- a/phc2sys.8 +++ b/phc2sys.8 @@ -362,12 +362,12 @@ Same as option .TP .B step_threshold -Specifies the step threshold of the servo. It is the maximum offset that -the servo corrects by changing the clock frequency instead of stepping -the clock. The clock is stepped on start regardless of the option if the -offset is larger than 20 microseconds (unless the -F option is used). -It's specified in seconds. The value of 0.0 disables stepping after -the start. The default is 0.0. +Specifies the step threshold of the servo. It is the maximum offset that the +servo corrects by changing the clock frequency (phase when using nullf servo) +instead of stepping the clock. The clock is stepped on start regardless of the +option if the offset is larger than 20 microseconds (unless the -F option is +used). It's specified in seconds. The value of 0.0 disables stepping after the +start. The default is 0.0. Same as option .B \-S (see above). diff --git a/ptp4l.8 b/ptp4l.8 index 1268802..10316ad 100644 --- a/ptp4l.8 +++ b/ptp4l.8 @@ -591,18 +591,18 @@ the PI controller from the sync interval. The default is 0.3. .TP .B step_threshold -The maximum offset the servo will correct by changing the clock -frequency instead of stepping the clock. When set to 0.0, the servo will -never step the clock except on start. It's specified in seconds. +The maximum offset the servo will correct by changing the clock frequency (phase +when using nullf servo) instead of stepping the clock. When set to 0.0, the +servo will never step the clock except on start. It's specified in seconds. The default is 0.0. This option used to be called .BR pi_offset_const . .TP .B first_step_threshold -The maximum offset the servo will correct by changing the clock -frequency instead of stepping the clock. This is only applied on the first -update. It's specified in seconds. When set to 0.0, the servo won't step -the clock on start. +The maximum offset the servo will correct by changing the clock frequency (phase +when using nullf servo) instead of stepping the clock. This is only applied on +the first update. It's specified in seconds. When set to 0.0, the servo won't +step the clock on start. The default is 0.00002 (20 microseconds). This option used to be called .BR pi_f_offset_const . diff --git a/ts2phc.8 b/ts2phc.8 index ded6f9a..ef78c6b 100644 --- a/ts2phc.8 +++ b/ts2phc.8 @@ -119,10 +119,10 @@ command line option. .TP .B first_step_threshold -The maximum offset, specified in seconds, that the servo will correct -by changing the clock frequency instead of stepping the clock. This is -only applied on the first update. When set to 0.0, the servo will not -step the clock on start. +The maximum offset, specified in seconds, that the servo will correct by +changing the clock frequency (phase when using nullf servo) instead of stepping +the clock. This is only applied on the first update. When set to 0.0, the servo +will not step the clock on start. The default is 0.00002 (20 microseconds). .TP .B free_running -- 2.36.2 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel