diff options
author | Ji Sheng Teoh <[email protected]> | 2024-01-30 13:51:18 +0800 |
---|---|---|
committer | Wim Van Sebroeck <[email protected]> | 2024-03-03 14:17:29 +0100 |
commit | d869d6352a5c2b13e76c19ba8f7243f422cf3fd0 (patch) | |
tree | 050552fe9450606e496c2ad3e9183c6151962cd8 | |
parent | 8bc22a2f1bf0f402029087fcb53130233a544fed (diff) |
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]>
-rw-r--r-- | drivers/watchdog/starfive-wdt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c index df68ae4acbd7..b4b059883618 100644 --- a/drivers/watchdog/starfive-wdt.c +++ b/drivers/watchdog/starfive-wdt.c @@ -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) |