ntp: convert HW timestamp even if PHC reading fails
Reading of PHC can fail occasionally on some hardware. If that happens, don't abort the conversion of the timestamp that triggered the reading.
This commit is contained in:
parent
d530055917
commit
c23c0b8484
1 changed files with 8 additions and 9 deletions
|
@ -569,16 +569,15 @@ process_hw_timestamp(struct Interface *iface, struct timespec *hw_ts,
|
||||||
double rx_correction, ts_delay, phc_err, local_err;
|
double rx_correction, ts_delay, phc_err, local_err;
|
||||||
|
|
||||||
if (HCL_NeedsNewSample(iface->clock, &local_ts->ts)) {
|
if (HCL_NeedsNewSample(iface->clock, &local_ts->ts)) {
|
||||||
if (!SYS_Linux_GetPHCSample(iface->phc_fd, iface->phc_nocrossts, iface->precision,
|
if (SYS_Linux_GetPHCSample(iface->phc_fd, iface->phc_nocrossts, iface->precision,
|
||||||
&iface->phc_mode, &sample_phc_ts, &sample_sys_ts,
|
&iface->phc_mode, &sample_phc_ts, &sample_sys_ts,
|
||||||
&phc_err))
|
&phc_err)) {
|
||||||
return;
|
LCL_CookTime(&sample_sys_ts, &sample_local_ts, &local_err);
|
||||||
|
HCL_AccumulateSample(iface->clock, &sample_phc_ts, &sample_local_ts,
|
||||||
|
phc_err + local_err);
|
||||||
|
|
||||||
LCL_CookTime(&sample_sys_ts, &sample_local_ts, &local_err);
|
update_interface_speed(iface);
|
||||||
HCL_AccumulateSample(iface->clock, &sample_phc_ts, &sample_local_ts,
|
}
|
||||||
phc_err + local_err);
|
|
||||||
|
|
||||||
update_interface_speed(iface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We need to transpose RX timestamps as hardware timestamps are normally
|
/* We need to transpose RX timestamps as hardware timestamps are normally
|
||||||
|
|
Loading…
Reference in a new issue