linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Cc: wim@linux-watchdog.org, shawnguo@kernel.org,
	linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Michal Koziel <michal.koziel@emlogic.no>
Subject: Re: [PATCH v2 2/2] watchdog: imx2_wdg: notify wdog core to stop ping worker on suspend
Date: Mon, 28 Jun 2021 07:02:51 -0700	[thread overview]
Message-ID: <20210628140251.GA426379@roeck-us.net> (raw)
In-Reply-To: <20210618195033.3209598-3-grzegorz.jaszczyk@linaro.org>

On Fri, Jun 18, 2021 at 09:50:33PM +0200, Grzegorz Jaszczyk wrote:
> Suspend routine disables wdog clk. Nevertheless, the watchdog subsystem
> is not aware of that and can still try to ping wdog through
> watchdog_ping_work. In order to prevent such condition and therefore
> prevent from system hang (caused by the wdog register access issued
> while the wdog clock is disabled) notify watchdog core that the ping
> worker should be canceled during watchdog core suspend and restored
> during resume.
> 
> Signed-off-by: Michal Koziel <michal.koziel@emlogic.no>
> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>

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

> ---
> v1->v2:
> - Do not use watchdog_dev_suspend/resume directly, instead notify the
> watchdog core that the ping worker should be canceled during watchdog
> core suspend and restored during resume.
> - Commit log was updated accordingly.
> ---
>  drivers/watchdog/imx2_wdt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
> index b84f80f7d342..3e8d9c3b6386 100644
> --- a/drivers/watchdog/imx2_wdt.c
> +++ b/drivers/watchdog/imx2_wdt.c
> @@ -311,6 +311,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
>  	watchdog_set_nowayout(wdog, nowayout);
>  	watchdog_set_restart_priority(wdog, 128);
>  	watchdog_init_timeout(wdog, timeout, dev);
> +	watchdog_stop_ping_on_suspend(wdog);
>  
>  	if (imx2_wdt_is_running(wdev)) {
>  		imx2_wdt_set_timeout(wdog, wdog->timeout);

  reply	other threads:[~2021-06-28 14:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 19:50 [PATCH v2 0/2] introduce watchdog_dev_suspend/resume Grzegorz Jaszczyk
2021-06-18 19:50 ` [PATCH v2 1/2] watchdog: " Grzegorz Jaszczyk
2021-06-28 14:04   ` Guenter Roeck
2021-06-18 19:50 ` [PATCH v2 2/2] watchdog: imx2_wdg: notify wdog core to stop ping worker on suspend Grzegorz Jaszczyk
2021-06-28 14:02   ` Guenter Roeck [this message]
2021-07-21  7:51 ` [PATCH v2 0/2] introduce watchdog_dev_suspend/resume Grzegorz Jaszczyk

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=20210628140251.GA426379@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=grzegorz.jaszczyk@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=michal.koziel@emlogic.no \
    --cc=shawnguo@kernel.org \
    --cc=wim@linux-watchdog.org \
    --subject='Re: [PATCH v2 2/2] watchdog: imx2_wdg: notify wdog core to stop ping worker on suspend' \
    /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

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 NNTP newsgroup(s).