All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] watchdog: msc313e: Propagate error code in resume()
@ 2026-09-12 16:33 Tzung-Bi Shih
  2026-09-12 16:42 ` sashiko-bot
  2026-09-17  0:29 ` Guenter Roeck
  0 siblings, 2 replies; 6+ messages in thread
From: Tzung-Bi Shih @ 2026-09-12 16:33 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: Daniel Palmer, Romain Perier, linux-watchdog, linux-kernel,
	tzungbi

If msc313e_wdt_start() fails during system resume, the error is
currently ignored.  Consequently, the watchdog isn't running without the
user's knowledge.

Propagate the error code and print a message if msc313e_wdt_start()
fails.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
v3:
- Don't clear WDOG_HW_RUNNING and WDOG_ACTIVE flags if
  msc313e_wdt_start() fails in msc313e_wdt_resume() which hides the dead
  state (Sashiko reported).

v2: https://lore.kernel.org/all/20260828161348.13212-9-tzungbi@kernel.org
- New to the series.
---
 drivers/watchdog/msc313e_wdt.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/watchdog/msc313e_wdt.c b/drivers/watchdog/msc313e_wdt.c
index f5a5afd91b98..dc7bdd5660e6 100644
--- a/drivers/watchdog/msc313e_wdt.c
+++ b/drivers/watchdog/msc313e_wdt.c
@@ -191,11 +191,15 @@ static int msc313e_wdt_suspend(struct device *dev)
 static int msc313e_wdt_resume(struct device *dev)
 {
 	struct msc313e_wdt_priv *priv = dev_get_drvdata(dev);
+	int ret = 0;
 
-	if (watchdog_active(&priv->wdev) || watchdog_hw_running(&priv->wdev))
-		msc313e_wdt_start(&priv->wdev);
+	if (watchdog_active(&priv->wdev) || watchdog_hw_running(&priv->wdev)) {
+		ret = msc313e_wdt_start(&priv->wdev);
+		if (ret)
+			dev_err(dev, "Failed to restart watchdog (err=%d)\n", ret);
+	}
 
-	return 0;
+	return ret;
 }
 
 static DEFINE_SIMPLE_DEV_PM_OPS(msc313e_wdt_pm_ops, msc313e_wdt_suspend, msc313e_wdt_resume);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-17  0:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-12 16:33 [PATCH v3] watchdog: msc313e: Propagate error code in resume() Tzung-Bi Shih
2026-09-12 16:42 ` sashiko-bot
2026-09-16  4:45   ` Triet Hoang
2026-09-16  7:10     ` Tzung-Bi Shih
2026-09-16  9:10       ` Guenter Roeck
2026-09-17  0:29 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.