mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Meng Li <Meng.Li@windriver.com>,
	wim@linux-watchdog.org, linux-watchdog@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: core: stop watchdog when executing poweroff command
Date: Thu, 29 Jun 2023 22:44:37 -0700	[thread overview]
Message-ID: <5a6cb162-790a-d24a-8946-090f4a893cf7@roeck-us.net> (raw)
In-Reply-To: <20230630053912.28205-1-Meng.Li@windriver.com>

On 6/29/23 22:39, Meng Li wrote:
> From: Meng Li <meng.li@windriver.com>
> 
> On some platforms, for example, Intel SoC FPGA platform, the watchdog is
> started in from u-boot, and so kernel will create a timer and work to
> keep watchdog alive. .But when user executes commands "poweroff" or
> "shutdown -h", the system is reset when watchdog triggers timeout even
> if WDOG_STOP_ON_REBOOT is set in watchdog driver. The root cause is
> that the watchdog not stopped properly because the SYS_POWER_OFF case
> is not supported in nofify callback function. So, add this case to stop
> watchdog when executing poweroff command.
> 
> Signed-off-by: Meng Li <Meng.Li@windriver.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/watchdog_core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
> index d4c5a736fdcb..5b55ccae06d4 100644
> --- a/drivers/watchdog/watchdog_core.c
> +++ b/drivers/watchdog/watchdog_core.c
> @@ -161,7 +161,7 @@ static int watchdog_reboot_notifier(struct notifier_block *nb,
>   	struct watchdog_device *wdd;
>   
>   	wdd = container_of(nb, struct watchdog_device, reboot_nb);
> -	if (code == SYS_DOWN || code == SYS_HALT) {
> +	if (code == SYS_DOWN || code == SYS_HALT || code == SYS_POWER_OFF) {
>   		if (watchdog_hw_running(wdd)) {
>   			int ret;
>   


      reply	other threads:[~2023-06-30  5:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30  5:39 Meng Li
2023-06-30  5:44 ` Guenter Roeck [this message]

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=5a6cb162-790a-d24a-8946-090f4a893cf7@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Meng.Li@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --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®