mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
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: efa859f7d7
("watchdog: Add Aspeed watchdog driver")
Reported-by: Amithash Prasad <amithash@fb.com>
Signed-off-by: Tao Ren <rentao.bupt@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210417034249.5978-1-rentao.bupt@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
parent
0102882979
commit
e7dc481c92
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue