Currently servo state stays in S3 (SERVO_LOCKED_STABLE) even though
clock offset increases above servo_offset_threshold value (but is still
below step_threshold value). With this change servo will switch to S2
(SERVO_LOCKED) every time clock offset is bigger than servo_offset_threshold.
It will still switch to S0 (SERVO_UNLOCKED) when clock offset is bigger than
step_threshold. It allows one to check only servo state and potentially 
simplifies
synchronization status monitoring.

Signed-off-by: PaweÅ‚ Modrzejewski <[email protected]>
---
 servo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/servo.c b/servo.c
index 46042aa..ad4ce7e 100644
--- a/servo.c
+++ b/servo.c
@@ -101,6 +101,8 @@ static int check_offset_threshold(struct servo *s, int64_t 
offset)
        if (s->offset_threshold) {
                if (abs_offset < s->offset_threshold && s->curr_offset_values)
                        s->curr_offset_values--;
+               if (abs_offset >= s->offset_threshold && s->curr_offset_values 
< s->num_offset_values)
+                       s->curr_offset_values = s->num_offset_values;
                return s->curr_offset_values ? 0 : 1;
        }
        return 0;
-- 
2.34.1


_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to