All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Philipp Zabel <p.zabel@pengutronix.de>, linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@iguana.be>,
	support.opensource@diasemi.com, kernel@pengutronix.de
Subject: Re: [PATCH 2/2] watchdog: da9063: Disable and wait before changing timeout
Date: Fri, 07 Aug 2015 06:40:04 -0700	[thread overview]
Message-ID: <55C4B534.5050602@roeck-us.net> (raw)
In-Reply-To: <1438879019-12978-2-git-send-email-p.zabel@pengutronix.de>

On 08/06/2015 09:36 AM, Philipp Zabel wrote:
> The DA9063 watchdog occasionally enters error condition and resets the
> system if the timeout is changed quickly after the timer was enabled.
>
> The method of disabling and waiting for > 150 µs before setting the
> new timeout is taken from the DA9052 driver.
>
Using sleep concerns me a bit, since during that time the watchdog
is disabled. Bad enough that we have to do this to start with,
but using usleep adds more risk to an already bad situation.

How about udelay() instead ?

Thanks,
Guenter

> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>   drivers/watchdog/da9063_wdt.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c
> index b2e9201..87e14d8 100644
> --- a/drivers/watchdog/da9063_wdt.c
> +++ b/drivers/watchdog/da9063_wdt.c
> @@ -67,6 +67,11 @@ static int _da9063_wdt_set_timeout(struct da9063_watchdog *wdt,
>   	mutex_lock(&wdt->mutex);
>
>   	ret = regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D,
> +				 DA9063_TWDSCALE_MASK, DA9063_TWDSCALE_DISABLE);
> +
> +	usleep_range(150, 300);
> +
> +	ret = regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D,
>   				 DA9063_TWDSCALE_MASK, regval);
>
>   	wdt->defer_ping = false;
>


  reply	other threads:[~2015-08-07 13:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 16:36 [PATCH 1/2] watchdog: da9063: Ping watchdog only during allowed time window Philipp Zabel
2015-08-06 16:36 ` [PATCH 2/2] watchdog: da9063: Disable and wait before changing timeout Philipp Zabel
2015-08-07 13:40   ` Guenter Roeck [this message]
2015-08-07 17:09     ` Philipp Zabel
2015-08-07 10:13 ` [PATCH 1/2] watchdog: da9063: Ping watchdog only during allowed time window Opensource [Adam Thomson]
2015-08-07 10:17   ` Philipp Zabel
2015-08-24 13:39     ` Opensource [Steve Twiss]
2015-08-07 13:36 ` Guenter Roeck
2015-08-07 17:08   ` Philipp Zabel
2015-08-07 17:33     ` Guenter Roeck

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=55C4B534.5050602@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=kernel@pengutronix.de \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=support.opensource@diasemi.com \
    --cc=wim@iguana.be \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.