Linux-Watchdog Archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>,
	Xingyu Wu <xingyu.wu@starfivetech.com>,
	Samin Guo <samin.guo@starfivetech.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Emil Renner Berthing <emil.renner.berthing@canonical.com>
Cc: Ley Foon Tan <leyfoon.tan@starfivetech.com>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sia Jee Heng <jeeheng.sia@starfivetech.com>
Subject: Re: [PATCH] watchdog: starfive: check watchdog status before enabling in system resume
Date: Mon, 29 Jan 2024 22:07:16 -0800	[thread overview]
Message-ID: <d967e5f3-6431-4fa0-8df8-345b8bbe9073@roeck-us.net> (raw)
In-Reply-To: <20240130055118.1917086-1-jisheng.teoh@starfivetech.com>

On 1/29/24 21:51, Ji Sheng Teoh wrote:
> System resume will start and enable watchdog regardless of whether the
> watchdog is enabled/disabled during a system suspend.
> Add a check to the watchdog status and only start and enable the
> watchdog if the watchdog status is running/active.
> 
> Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>
> Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>

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

> ---
>   drivers/watchdog/starfive-wdt.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
> index e28ead24c520..f72fc38a41f8 100644
> --- a/drivers/watchdog/starfive-wdt.c
> +++ b/drivers/watchdog/starfive-wdt.c
> @@ -554,7 +554,10 @@ static int starfive_wdt_resume(struct device *dev)
>   	starfive_wdt_set_reload_count(wdt, wdt->reload);
>   	starfive_wdt_lock(wdt);
>   
> -	return starfive_wdt_start(wdt);
> +	if (watchdog_active(&wdt->wdd))
> +		return starfive_wdt_start(wdt);
> +
> +	return 0;
>   }
>   
>   static int starfive_wdt_runtime_suspend(struct device *dev)


      reply	other threads:[~2024-01-30  6:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  5:51 [PATCH] watchdog: starfive: check watchdog status before enabling in system resume Ji Sheng Teoh
2024-01-30  6:07 ` 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=d967e5f3-6431-4fa0-8df8-345b8bbe9073@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=emil.renner.berthing@canonical.com \
    --cc=jeeheng.sia@starfivetech.com \
    --cc=jisheng.teoh@starfivetech.com \
    --cc=leyfoon.tan@starfivetech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=samin.guo@starfivetech.com \
    --cc=wim@linux-watchdog.org \
    --cc=xingyu.wu@starfivetech.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).