aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTao Ren <[email protected]>2021-04-16 20:42:49 -0700
committerWim Van Sebroeck <[email protected]>2021-06-21 08:49:04 +0200
commite7dc481c92060f9ce872878b0b7a08c24713a7e5 (patch)
treef69db179818cf2ade11dcb75d6e66b811e317444
parent0102882979582b6f9a351edcf600da9574030193 (diff)
watchdog: aspeed: fix hardware timeout calculation
Fix hardware timeout calculation in aspeed_wdt_set_timeout function to ensure the reload value does not exceed the hardware limit. Fixes: efa859f7d786 ("watchdog: Add Aspeed watchdog driver") Reported-by: Amithash Prasad <[email protected]> Signed-off-by: Tao Ren <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
-rw-r--r--drivers/watchdog/aspeed_wdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
index 933998e5a9de..436571b6fc79 100644
--- a/drivers/watchdog/aspeed_wdt.c
+++ b/drivers/watchdog/aspeed_wdt.c
@@ -147,7 +147,7 @@ static int aspeed_wdt_set_timeout(struct watchdog_device *wdd,
wdd->timeout = timeout;
- actual = min(timeout, wdd->max_hw_heartbeat_ms * 1000);
+ actual = min(timeout, wdd->max_hw_heartbeat_ms / 1000);
writel(actual * WDT_RATE_1MHZ, wdt->base + WDT_RELOAD_VALUE);
writel(WDT_RESTART_MAGIC, wdt->base + WDT_RESTART);