mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Daniel Palmer <daniel@0x0f.com>,
	wim@linux-watchdog.org, linux-watchdog@vger.kernel.org
Cc: romain.perier@gmail.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: msc313e: Check if the WDT was running at boot
Date: Tue, 28 Dec 2021 08:06:09 -0800	[thread overview]
Message-ID: <1f60c5ac-b262-2b8f-6bf1-c1c7f2b20699@roeck-us.net> (raw)
In-Reply-To: <20211228073427.2443174-1-daniel@0x0f.com>

On 12/27/21 11:34 PM, Daniel Palmer wrote:
> Check if the WDT was running at boot and set the running
> flag if it was. This prevents the system from getting
> rebooted if the userland daemon doesn't take over soon enough
> or there isn't a userland daemon at all.
> 
> Signed-off-by: Daniel Palmer <daniel@0x0f.com>

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

> ---
>   drivers/watchdog/msc313e_wdt.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/watchdog/msc313e_wdt.c b/drivers/watchdog/msc313e_wdt.c
> index 0d497aa0fb7d..90171431fc59 100644
> --- a/drivers/watchdog/msc313e_wdt.c
> +++ b/drivers/watchdog/msc313e_wdt.c
> @@ -120,6 +120,10 @@ static int msc313e_wdt_probe(struct platform_device *pdev)
>   	priv->wdev.max_timeout = U32_MAX / clk_get_rate(priv->clk);
>   	priv->wdev.timeout = MSC313E_WDT_DEFAULT_TIMEOUT;
>   
> +	/* If the period is non-zero the WDT is running */
> +	if (readw(priv->base + REG_WDT_MAX_PRD_L) | (readw(priv->base + REG_WDT_MAX_PRD_H) << 16))
> +		set_bit(WDOG_HW_RUNNING, &priv->wdev.status);
> +
>   	watchdog_set_drvdata(&priv->wdev, priv);
>   
>   	watchdog_init_timeout(&priv->wdev, timeout, dev);
> 


      reply	other threads:[~2021-12-28 16:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-28  7:34 Daniel Palmer
2021-12-28 16:06 ` 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=1f60c5ac-b262-2b8f-6bf1-c1c7f2b20699@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=daniel@0x0f.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=romain.perier@gmail.com \
    --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®