[Linuxptp-devel] [PATCH] servo: allows servo state transition back from S3 to S2
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
|
From: Modrzejewski, P. <Paw...@ha...> - 2022-01-10 13:31:24
|
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 <paw...@ha...>
---
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
|