From db4bf4b968c0da035d98e7771fc993af9d6f742b Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Mon, 25 Apr 2022 21:52:39 +0200 Subject: 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 Tested-by: Martin Blumenstingl --- package/kernel/lantiq/ltq-vdsl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/kernel/lantiq/ltq-vdsl/Makefile') diff --git a/package/kernel/lantiq/ltq-vdsl/Makefile b/package/kernel/lantiq/ltq-vdsl/Makefile index 248615fb59..da924e861e 100644 --- a/package/kernel/lantiq/ltq-vdsl/Makefile +++ b/package/kernel/lantiq/ltq-vdsl/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-vdsl-vr9 PKG_VERSION:=4.17.18.6 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_BASE_NAME:=drv_dsl_cpe_api PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz -- cgit v1.2.3