From: Guenter Roeck <linux@roeck-us.net>
To: Yang Siyuan <hsyysy@163.com>, Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: linux-watchdog@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] watchdog: sunxi_wdt: stop the watchdog across system suspend
Date: Tue, 17 Nov 2026 16:28:05 -0800 [thread overview]
Message-ID: <ece4aa08-fb86-4f76-b4b8-a9351a71df14@roeck-us.net> (raw)
In-Reply-To: <20261117231819.264381-1-hsyysy@163.com>
On 11/17/26 15:18, Yang Siyuan wrote:
> The H616 watchdog has a maximum timeout of 16 seconds. systemd keeps
> /dev/watchdog0 open with RuntimeWatchdogSec=16s, but during system
> suspend all userspace is frozen and the watchdog core does not stop the
> hardware. A suspend longer than the timeout therefore resets the board
> before it can resume.
>
> Add system sleep PM ops to stop the watchdog before suspend and restart
> it after resume if it was running. The driver did not store its private
> data in the platform device, so add platform_set_drvdata() for the PM
> callbacks.
>
> Use DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(), and use
> watchdog_hw_running() instead of a private flag to decide whether the
> hardware needs to be stopped and restarted.
>
> Tested on an Anbernic RG35XX-SP: a 30-second s2idle suspend resumes
> without the 16-second watchdog reset, and /dev/watchdog0 keeps working
> afterwards.
>
> Signed-off-by: Yang Siyuan <hsyysy@163.com>
> ---
> Changes in v3:
> - Mark the PM callbacks __maybe_unused. With CONFIG_PM_SLEEP=n the
> pm_sleep_ptr() references expand to NULL, so both callbacks were unused
> and a W=1 build warned about them. Reported by the kernel test robot:
> https://lore.kernel.org/oe-kbuild-all/202611172344.RbQl66xu-lkp@intel.com/
That build report was for v1 of the patch. __maybe_unused is unnecessary
with DEFINE_SIMPLE_DEV_PM_OPS.
Guenter
next prev parent reply other threads:[~2026-11-18 0:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 9:20 [PATCH] " Yang Siyuan
2026-11-17 10:40 ` [PATCH v2] " Yang Siyuan
2026-11-17 15:51 ` [PATCH] " kernel test robot
2026-11-17 23:18 ` [PATCH v3] " Yang Siyuan
2026-11-18 0:28 ` Guenter Roeck [this message]
2026-11-18 0:50 ` [PATCH v4] " Yang Siyuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ece4aa08-fb86-4f76-b4b8-a9351a71df14@roeck-us.net \
--to=linux@roeck-us.net \
--cc=hsyysy@163.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®