mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 12:55:07 -05:00
hwclock: drop all samples on reset
On some HW it seems it's possible to get an occasional bad reading of the PHC (with normal delay), or in a worse case the clock can step due to a HW/driver bug, which triggers reset of the HW clock instance. To avoid having a bad estimate of the frequency when the next (good) sample is accumulated, drop also the last sample which triggered the reset.
This commit is contained in:
@@ -65,7 +65,7 @@ test_unit(void)
|
||||
if (HCL_NeedsNewSample(clock, &local_ts))
|
||||
HCL_AccumulateSample(clock, &hw_ts, &local_ts, 2.0 * jitter);
|
||||
|
||||
TEST_CHECK(j < 20 || clock->valid_coefs);
|
||||
TEST_CHECK(clock->valid_coefs || clock->n_samples < 2);
|
||||
|
||||
if (!clock->valid_coefs)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user