Re: [PATCH 2/2] watchdog: da9063: Disable and wait before changing timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
  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;


--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux