Remove unnecessary wait state from frequency estimator.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
843661dfa2
commit
8a4b2ab9b8
10
clock.c
10
clock.c
|
@ -199,6 +199,11 @@ static enum servo_state clock_no_adjust(struct clock *c)
|
||||||
* By leaving out the path delay altogther, we can avoid the
|
* By leaving out the path delay altogther, we can avoid the
|
||||||
* error caused by our imperfect path delay measurement.
|
* error caused by our imperfect path delay measurement.
|
||||||
*/
|
*/
|
||||||
|
if (!f->ingress1) {
|
||||||
|
f->ingress1 = c->t2;
|
||||||
|
f->origin1 = tmv_add(c->t1, tmv_add(c->c1, c->c2));
|
||||||
|
return state;
|
||||||
|
}
|
||||||
f->count++;
|
f->count++;
|
||||||
if (f->count < f->max_count) {
|
if (f->count < f->max_count) {
|
||||||
return state;
|
return state;
|
||||||
|
@ -207,9 +212,10 @@ static enum servo_state clock_no_adjust(struct clock *c)
|
||||||
* origin2 = c->t1 (+c->path_delay) + c->c1 + c->c2;
|
* origin2 = c->t1 (+c->path_delay) + c->c1 + c->c2;
|
||||||
*/
|
*/
|
||||||
origin2 = tmv_add(c->t1, tmv_add(c->c1, c->c2));
|
origin2 = tmv_add(c->t1, tmv_add(c->c1, c->c2));
|
||||||
if (f->ingress1) {
|
|
||||||
ratio = tmv_dbl(tmv_sub(origin2, f->origin1)) /
|
ratio = tmv_dbl(tmv_sub(origin2, f->origin1)) /
|
||||||
tmv_dbl(tmv_sub(c->t2, f->ingress1));
|
tmv_dbl(tmv_sub(c->t2, f->ingress1));
|
||||||
|
|
||||||
pr_info("master offset %10lld s%d ratio %.9f path delay %10lld",
|
pr_info("master offset %10lld s%d ratio %.9f path delay %10lld",
|
||||||
c->master_offset, state, ratio, c->path_delay);
|
c->master_offset, state, ratio, c->path_delay);
|
||||||
|
|
||||||
|
@ -223,7 +229,7 @@ static enum servo_state clock_no_adjust(struct clock *c)
|
||||||
pr_debug("sum-1 %.9f", fui + c->nrr - 1.0);
|
pr_debug("sum-1 %.9f", fui + c->nrr - 1.0);
|
||||||
pr_debug("master/local %.9f", ratio);
|
pr_debug("master/local %.9f", ratio);
|
||||||
pr_debug("diff %+.9f", ratio - (fui + c->nrr - 1.0));
|
pr_debug("diff %+.9f", ratio - (fui + c->nrr - 1.0));
|
||||||
}
|
|
||||||
f->ingress1 = c->t2;
|
f->ingress1 = c->t2;
|
||||||
f->origin1 = origin2;
|
f->origin1 = origin2;
|
||||||
f->count = 0;
|
f->count = 0;
|
||||||
|
|
Loading…
Reference in New Issue