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] [thread-next>] [day] [month] [year] [list]
Message-ID: <175325504388.1420.5766368325078103873.tip-bot2@tip-bot2>
Date: Wed, 23 Jul 2025 07:17:23 -0000
From: "tip-bot2 for Guenter Roeck" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Pohsun Su <pohsuns@...dia.com>, Robert Lin <robelin@...dia.com>,
 Guenter Roeck <linux@...ck-us.net>, Jon Hunter <jonathanh@...dia.com>,
 Daniel Lezcano <daniel.lezcano@...aro.org>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: timers/clocksource] clocksource/drivers/timer-tegra186: Avoid
 64-bit divide operation

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

Commit-ID:     eda68f63d2bbc16a485f9f0f4df79253ae5353f2
Gitweb:        https://git.kernel.org/tip/eda68f63d2bbc16a485f9f0f4df79253ae5353f2
Author:        Guenter Roeck <linux@...ck-us.net>
AuthorDate:    Sat, 14 Jun 2025 10:55:55 -07:00
Committer:     Daniel Lezcano <daniel.lezcano@...aro.org>
CommitterDate: Tue, 15 Jul 2025 13:08:07 +02:00

clocksource/drivers/timer-tegra186: Avoid 64-bit divide operation

Building the driver on xtensa fails with

tensa-linux-ld: drivers/clocksource/timer-tegra186.o:
	in function `tegra186_timer_remove':
timer-tegra186.c:(.text+0x350):
	undefined reference to `__udivdi3'

Avoid the problem by rearranging the offending code to avoid the 64-bit
divide operation.

Fixes: 28c842c8b0f5 ("clocksource/drivers/timer-tegra186: Add WDIOC_GETTIMELEFT support")
Cc: Pohsun Su <pohsuns@...dia.com>
Cc: Robert Lin <robelin@...dia.com>
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
Reviewed-by: Jon Hunter <jonathanh@...dia.com>
Link: https://lore.kernel.org/r/20250614175556.922159-1-linux@roeck-us.net
Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.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 56a5342..76a5481 100644
--- a/drivers/clocksource/timer-tegra186.c
+++ b/drivers/clocksource/timer-tegra186.c
@@ -267,7 +267,7 @@ static unsigned int tegra186_wdt_get_timeleft(struct watchdog_device *wdd)
 	 * counter value to the time of the counter expirations that
 	 * remain.
 	 */
-	timeleft += (((u64)wdt->base.timeout * USEC_PER_SEC) / 5) * (4 - expiration);
+	timeleft += ((u64)wdt->base.timeout * (USEC_PER_SEC / 5)) * (4 - expiration);
 
 	/*
 	 * Convert the current counter value to seconds,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ