linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Michael Walle <michael@walle.cc>,
	linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org
Cc: Jongsung Kim <neidhard.kim@lge.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>
Subject: Re: [PATCH] watchdog: sp805: fix restart handler
Date: Fri, 27 Mar 2020 13:42:04 -0700	[thread overview]
Message-ID: <89ad42e9-8852-7ffd-6bfa-6db602caa51c@roeck-us.net> (raw)
In-Reply-To: <20200327162450.28506-1-michael@walle.cc>

On 3/27/20 9:24 AM, Michael Walle wrote:
> The restart handler is missing two things, first, the registers
> has to be unlocked and second there is no synchronization for the
> write_relaxed() calls.
> 
> This was tested on a custom board with the NXP LS1028A SoC.
> 
> Fixes: 6c5c0d48b686c ("watchdog: sp805: add restart handler")
> Signed-off-by: Michael Walle <michael@walle.cc>

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

> ---
>  drivers/watchdog/sp805_wdt.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
> index 53e04926a7b2..190d26e2e75f 100644
> --- a/drivers/watchdog/sp805_wdt.c
> +++ b/drivers/watchdog/sp805_wdt.c
> @@ -137,10 +137,14 @@ wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd)
>  {
>  	struct sp805_wdt *wdt = watchdog_get_drvdata(wdd);
>  
> +	writel_relaxed(UNLOCK, wdt->base + WDTLOCK);
>  	writel_relaxed(0, wdt->base + WDTCONTROL);
>  	writel_relaxed(0, wdt->base + WDTLOAD);
>  	writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL);
>  
> +	/* Flush posted writes. */
> +	readl_relaxed(wdt->base + WDTLOCK);
> +
>  	return 0;
>  }
>  
> 


      reply	other threads:[~2020-03-27 20:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 16:24 [PATCH] watchdog: sp805: fix restart handler Michael Walle
2020-03-27 20:42 ` 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=89ad42e9-8852-7ffd-6bfa-6db602caa51c@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=neidhard.kim@lge.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;
as well as URLs for NNTP newsgroup(s).