Commit d869d635 authored by Ji Sheng Teoh's avatar Ji Sheng Teoh Committed by Wim Van Sebroeck

watchdog: starfive: check watchdog status before enabling in system resume

System resume will start and enable watchdog regardless of whether the
watchdog is enabled/disabled during a system suspend.
Add a check to the watchdog status and only start and enable the
watchdog if the watchdog status is running/active.
Signed-off-by: default avatarSia Jee Heng <jeeheng.sia@starfivetech.com>
Signed-off-by: default avatarJi Sheng Teoh <jisheng.teoh@starfivetech.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240130055118.1917086-1-jisheng.teoh@starfivetech.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 8bc22a2f
......@@ -559,7 +559,10 @@ static int starfive_wdt_resume(struct device *dev)
starfive_wdt_set_reload_count(wdt, wdt->reload);
starfive_wdt_lock(wdt);
return starfive_wdt_start(wdt);
if (watchdog_active(&wdt->wdd))
return starfive_wdt_start(wdt);
return 0;
}
static int starfive_wdt_runtime_suspend(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment