]> git.ipfire.org Git - thirdparty/chrony.git/commit
refclock: drop filter length adjustment for polling drivers
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 11 Dec 2024 10:16:30 +0000 (11:16 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 11 Dec 2024 10:45:13 +0000 (11:45 +0100)
commit8ee725ff188a8b4be9b060a02d8fcb3f38cf88fa
tree40e8f409556bc40a401d81d97a19ce5b2470f73d
parenta90a7cf51ce190959818f26ba1a1f0a68028c8c4
refclock: drop filter length adjustment for polling drivers

In the refclock initialization, if the driver provides a poll()
function and 2^(poll-dpoll) is smaller than the configured length of the
median filter (64 by default), the filter is shortened to 2^(poll-dpoll)
samples, assuming the driver provides samples only in the poll()
function and at most one per call, to avoid wasting memory and before
commit 12237bf28393 ("refclock: stop requiring 4 samples in median
filter") also simplify configuration (for polling drivers only)

But this assumption is not always correct. The PHC driver can read
external PPS timestamps independently from the driver polling and the
RTC driver can timestamp interrupts. If the dpoll was too large to cover
the sample rate, some samples would be lost.

Drop the adjustment of the filter length to avoid this unexpected impact
on filtering and make it work as documented.
refclock.c