mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Xiaofeng Wei <xiaofeng.wei@nxp.com>
Cc: wim@iguana.be, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org, hongjun.chen@nxp.com
Subject: Re: [PATCH] watchdog: booke_wdt: Disable the watchdog prior to setting a new timeout value in order to avoid the following situation
Date: Thu, 22 Mar 2018 09:47:10 -0700	[thread overview]
Message-ID: <20180322164710.GA31876@roeck-us.net> (raw)
In-Reply-To: <20180322035146.1236-1-xiaofeng.wei@nxp.com>

On Thu, Mar 22, 2018 at 11:51:46AM +0800, Xiaofeng Wei wrote:
> A watchdog timer exception also occurs if the selected time base bit transitions from 0 to 1 due
> to an mtspr that writes a 1 to the bit when its previous value was 0.
> 
Please drop "in order to ..." from the subject line. Every patch hopefully does
that.

> Signed-off-by: Xiaofeng Wei <xiaofeng.wei@nxp.com>
> ---
>  drivers/watchdog/booke_wdt.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
> index 3ad1e44..70e742c 100644
> --- a/drivers/watchdog/booke_wdt.c
> +++ b/drivers/watchdog/booke_wdt.c
> @@ -186,9 +186,15 @@ static int booke_wdt_stop(struct watchdog_device *wdog)
>  static int booke_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  				 unsigned int timeout)
>  {
> +	if (watchdog_active(wdt_dev))
> +		on_each_cpu(__booke_wdt_disable, NULL, 0);
> +

Thios would only be necessary if the timeout actually changes. Also, does
the problem apply to _all_ chips supported by this driver or only to a
subset ?

Guenter

>  	wdt_dev->timeout = timeout;
>  	booke_wdt_set(wdt_dev);
>  
> +	if (watchdog_active(wdt_dev))
> +		on_each_cpu(__booke_wdt_enable, wdt_dev, 0);
> +
>  	return 0;
>  }
>  
> -- 
> 2.9.3
> 

      reply	other threads:[~2018-03-22 16:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22  3:51 Xiaofeng Wei
2018-03-22 16:47 ` 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=20180322164710.GA31876@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=hongjun.chen@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@iguana.be \
    --cc=xiaofeng.wei@nxp.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

all inboxes | Powered by JetHome®