Skip to content

Commit d869d63

Browse files
JiShengTeohWim Van Sebroeck
authored andcommitted
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: Sia Jee Heng <[email protected]> Signed-off-by: Ji Sheng Teoh <[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]>
1 parent 8bc22a2 commit d869d63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/watchdog/starfive-wdt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,10 @@ static int starfive_wdt_resume(struct device *dev)
559559
starfive_wdt_set_reload_count(wdt, wdt->reload);
560560
starfive_wdt_lock(wdt);
561561

562-
return starfive_wdt_start(wdt);
562+
if (watchdog_active(&wdt->wdd))
563+
return starfive_wdt_start(wdt);
564+
565+
return 0;
563566
}
564567

565568
static int starfive_wdt_runtime_suspend(struct device *dev)

0 commit comments

Comments
 (0)