[PATCH] watchdog: gunyah: report system sleep operation failures
From: Zhang Jiaxi
Date: Thu Oct 08 2026 - 18:35:29 EST
From: Jiaxi Zhang <z1529105815@xxxxxxxxxxx>
The system-sleep callbacks discard the errors returned by the watchdog
start and stop operations and always report success. If stopping an
active watchdog fails, the PM core can proceed to suspend while the
watchdog is still counting. Failed restart on resume is also hidden from
the PM core's callback error reporting.
Return the existing operation result when the watchdog is active. Keep
inactive callbacks as no-ops. The start/stop command sequence, initial
activation exception, probe registration and last-resort restart behavior
are unchanged. Reporting a resume error does not implement recovery or
guarantee that watchdog protection has been restored.
Signed-off-by: Jiaxi Zhang <z1529105815@xxxxxxxxxxx>
---
Clang 22.1.8 compiled the changed object on torvalds/linux
6c377d19d4a5116d9bec5203aa3c6c11523e7898 without diagnostics.
Actual callback tests with modeled start/stop returns cover error propagation
and inactive no-ops, including old-code negatives. No device PM or real
hypervisor-error injection is claimed.
drivers/watchdog/gunyah_wdt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/gunyah_wdt.c b/drivers/watchdog/gunyah_wdt.c
--- a/drivers/watchdog/gunyah_wdt.c
+++ b/drivers/watchdog/gunyah_wdt.c
@@ -214,7 +214,7 @@
struct watchdog_device *wdd = dev_get_drvdata(dev);
if (watchdog_active(wdd))
- gunyah_wdt_stop(wdd);
+ return gunyah_wdt_stop(wdd);
return 0;
}
@@ -224,7 +224,7 @@
struct watchdog_device *wdd = dev_get_drvdata(dev);
if (watchdog_active(wdd))
- gunyah_wdt_start(wdd);
+ return gunyah_wdt_start(wdd);
return 0;
}