lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <175343949555.1420.966974973330577851.tip-bot2@tip-bot2>
Date: Fri, 25 Jul 2025 10:31:35 -0000
From: "tip-bot2 for Arnd Bergmann" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Arnd Bergmann <arnd@...db.de>, Daniel Lezcano <daniel.lezcano@...aro.org>,
 Ingo Molnar <mingo@...nel.org>, x86@...nel.org, linux-kernel@...r.kernel.org
Subject:
 [tip: timers/clocksource] clocksource/drivers/tegra186: Avoid 64-bit division

The following commit has been merged into the timers/clocksource branch of tip:

Commit-ID:     836758dc1e43928aa1a357009f5c3164a00cbfb0
Gitweb:        https://git.kernel.org/tip/836758dc1e43928aa1a357009f5c3164a00cbfb0
Author:        Arnd Bergmann <arnd@...db.de>
AuthorDate:    Fri, 20 Jun 2025 13:19:35 +02:00
Committer:     Ingo Molnar <mingo@...nel.org>
CommitterDate: Fri, 25 Jul 2025 12:06:46 +02:00

clocksource/drivers/tegra186: Avoid 64-bit division

The newly added function causes a build failure on 32-bit targets with
older compiler version such as gcc-10:

  arm-linux-gnueabi-ld: drivers/clocksource/timer-tegra186.o: in function `tegra186_wdt_get_timeleft':
  timer-tegra186.c:(.text+0x3c2): undefined reference to `__aeabi_uldivmod'

The calculation can trivially be changed to avoid the division entirely,
as USEC_PER_SEC is a multiple of 5. Change both such calculation for
consistency, even though gcc apparently managed to optimize the other one
properly already.

[ dlezcano : Fixed conflict with 20250614175556.922159-2-linux@...ck-us.net ]

Fixes: 28c842c8b0f5 ("clocksource/drivers/timer-tegra186: Add WDIOC_GETTIMELEFT support")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Link: https://lore.kernel.org/r/20250620111939.3395525-1-arnd@kernel.org
---
 drivers/clocksource/timer-tegra186.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-tegra186.c b/drivers/clocksource/timer-tegra186.c
index d403a3f..1ec7b38 100644
--- a/drivers/clocksource/timer-tegra186.c
+++ b/drivers/clocksource/timer-tegra186.c
@@ -159,7 +159,7 @@ static void tegra186_wdt_enable(struct tegra186_wdt *wdt)
 	tmr_writel(wdt->tmr, TMRCSSR_SRC_USEC, TMRCSSR);
 
 	/* configure timer (system reset happens on the fifth expiration) */
-	value = TMRCR_PTV(wdt->base.timeout * USEC_PER_SEC / 5) |
+	value = TMRCR_PTV(wdt->base.timeout * (USEC_PER_SEC / 5)) |
 		TMRCR_PERIODIC | TMRCR_ENABLE;
 	tmr_writel(wdt->tmr, value, TMRCR);
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ