All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@iguana.be>,
	support.opensource@diasemi.com, kernel@pengutronix.de,
	Philipp Zabel <p.zabel@pengutronix.de>
Subject: [PATCH 2/2] watchdog: da9063: Disable and wait before changing timeout
Date: Thu,  6 Aug 2015 18:36:59 +0200	[thread overview]
Message-ID: <1438879019-12978-2-git-send-email-p.zabel@pengutronix.de> (raw)
In-Reply-To: <1438879019-12978-1-git-send-email-p.zabel@pengutronix.de>

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.

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;
-- 
2.4.6


  reply	other threads:[~2015-08-06 16:37 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 ` Philipp Zabel [this message]
2015-08-07 13:40   ` [PATCH 2/2] watchdog: da9063: Disable and wait before changing timeout Guenter Roeck
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=1438879019-12978-2-git-send-email-p.zabel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-watchdog@vger.kernel.org \
    --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.