[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231206141658.kjpjwjy7utdux6b5@pengutronix.de>
Date: Wed, 6 Dec 2023 15:16:58 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Bjorn Andersson <andersson@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Andy Gross <agross@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Stephen Boyd <swboyd@...omium.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] soc: qcom: stats: fix 64-bit division
Hallo Arnd,
On Wed, Dec 06, 2023 at 01:37:06PM +0100, Arnd Bergmann wrote:
> Unguarded 64-bit division is not allowed on 32-bit kernels because this
> is very slow. The result of trying anyway is a link failure:
>
> arm-linux-gnueabi-ld: drivers/soc/qcom/qcom_stats.o: in function `qcom_ddr_stats_show':
> qcom_stats.c:(.text+0x334): undefined reference to `__aeabi_uldivmod'
>
> As this function is only used for debugging and not performance critical,
> rewrite it to use div_u64() instead. ARCH_TIMER_FREQ is a multiple of
> MSEC_PER_SEC anyway, so there is no loss in precisison.
Maybe add this information in a comment?
We have
#define ARCH_TIMER_FREQ 19200000
so it's a multiple of MSEC_PER_SEC (= 1000) indeed.
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists