diff options
author | Jan Hoffmann <jan@3e8.eu> | 2022-04-25 21:52:39 +0200 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-05-04 01:38:04 +0100 |
commit | db4bf4b968c0da035d98e7771fc993af9d6f742b (patch) | |
tree | 65351f19e1437b701d673290f962f39bbb475db7 /package/boot/uboot-mediatek | |
parent | 2f484aeff5fe5ba3a832f98ca409adde3257e832 (diff) | |
download | upstream-db4bf4b968c0da035d98e7771fc993af9d6f742b.tar.gz upstream-db4bf4b968c0da035d98e7771fc993af9d6f742b.tar.bz2 upstream-db4bf4b968c0da035d98e7771fc993af9d6f742b.zip |
ltq-vdsl/ltq-adsl: fix elapsed time calculation
The driver maintains elapsed times by repeatedly accumulating the time
since the previous update in a loop. For the elapsed showtime time, the
time difference is truncated to seconds before adding it, leading to a
sizable error over time.
Move the truncation to before calculation of the time difference in
order to remove this error. Also maintain the total elapsed time in the
same way in full seconds, to prevent the unsigned 32-bit counter from
wrapping around after about 50 days.
Testing on a VR9 device shows that the reported line uptime now matches
the actual elapsed wall time. The ADSL variant is only compile-tested,
but it should also work as the relevant code is identical.
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Diffstat (limited to 'package/boot/uboot-mediatek')
0 files changed, 0 insertions, 0 deletions