mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] watchdog: gunyah: report system sleep operation failures
@ 2026-10-08 22:34 Zhang Jiaxi
  2026-10-09  1:07 ` Trilok Soni
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang Jiaxi @ 2026-10-08 22:34 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: Bjorn Andersson, Konrad Dybcio, linux-arm-msm, linux-watchdog,
	linux-kernel

From: Jiaxi Zhang <z1529105815@outlook.com>

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@outlook.com>
---
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;
 }

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

* Re: [PATCH] watchdog: gunyah: report system sleep operation failures
  2026-10-08 22:34 [PATCH] watchdog: gunyah: report system sleep operation failures Zhang Jiaxi
@ 2026-10-09  1:07 ` Trilok Soni
  2026-10-09  8:50   ` Zhang Jiaxi
  0 siblings, 1 reply; 3+ messages in thread
From: Trilok Soni @ 2026-10-09  1:07 UTC (permalink / raw)
  To: Zhang Jiaxi, Wim Van Sebroeck, Guenter Roeck
  Cc: Bjorn Andersson, Konrad Dybcio, linux-arm-msm, linux-watchdog,
	linux-kernel

On 10/8/2026 3:34 PM, Zhang Jiaxi wrote:
> From: Jiaxi Zhang <z1529105815@outlook.com>
> 
> 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@outlook.com>

I see flurry of emails from you. What exactly are you testing here? Is this driven
through LLM? 

Please also fix your SOB line. 

> ---
> 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;
>  }
> 


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

* RE: [PATCH] watchdog: gunyah: report system sleep operation failures
  2026-10-09  1:07 ` Trilok Soni
@ 2026-10-09  8:50   ` Zhang Jiaxi
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang Jiaxi @ 2026-10-09  8:50 UTC (permalink / raw)
  To: Trilok Soni, Wim Van Sebroeck, Guenter Roeck
  Cc: Bjorn Andersson, Konrad Dybcio, linux-arm-msm, linux-watchdog,
	linux-kernel

Hi Trilok,

Yes, I used Codex/LLM assistance for source analysis, patch drafting, and
preparation of the host-side tests. I remain responsible for the submission
and its DCO sign-off. I should have disclosed this assistance explicitly,
and I will include the appropriate Assisted-by attribution in any revision.

These patches arose from separate issues encountered while bringing up
native Linux on Xiaomi Warsaw/SM8750. However, that device work does not
establish hardware validation of this Gunyah watchdog change.

For this patch, the tests used functions and SMCCC definitions extracted
from upstream Linux, with simulated SMC return values. Ten host-side cases
passed under Clang ASan/UBSan, including negative controls demonstrating
the original callbacks' error-handling behavior.

The modified gunyah_wdt.o also compiled against torvalds/linux at
6c377d19d4a5 without compiler diagnostics.

I have not tested actual Gunyah SMC failures, device suspend/resume, or
watchdog recovery. The evidence supports the source-level error-propagation
change, not hardware PM validation.

Regarding the Signed-off-by line, my intended identity is:

Signed-off-by: Jiaxi Zhang <z1529105815@outlook.com>

The earlier email displayed my name in Chinese order (family name first)
as "Zhang Jiaxi", while the patch uses "Jiaxi Zhang" in Western order. Both
refer to the same person and email address (z1529105815@outlook.com).

If you were referring to another issue with the sign-off, please let me
know and I will correct it in the next revision.

Thank you for your review.

Best regards,
Jiaxi

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

end of thread, other threads:[~2026-10-09  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-08 22:34 [PATCH] watchdog: gunyah: report system sleep operation failures Zhang Jiaxi
2026-10-09  1:07 ` Trilok Soni
2026-10-09  8:50   ` Zhang Jiaxi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®