summaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-03-11 00:22:17 +0200
committerWim Van Sebroeck <wim@iguana.be>2017-06-05 20:37:35 +0200
commit954351e8707bcdf6091cc55dab4e9e2453de6655 (patch)
treebb65e08a511d8fab96f7392902e7b5162c4e86ef /drivers/watchdog
parent0ab1380804ad709ced066eb10568110987e42570 (diff)
watchdog: intel-mid_wdt: Keep watchdog running
Firmware followed by bootloader leaves watchdog running. Keep it running in the driver. User will not need any additional options to reboot in case of panic during boot. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/intel-mid_wdt.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/watchdog/intel-mid_wdt.c b/drivers/watchdog/intel-mid_wdt.c
index 45e4d02221b5..72c108a12c19 100644
--- a/drivers/watchdog/intel-mid_wdt.c
+++ b/drivers/watchdog/intel-mid_wdt.c
@@ -147,8 +147,21 @@ static int mid_wdt_probe(struct platform_device *pdev)
return ret;
}
- /* Make sure the watchdog is not running */
- wdt_stop(wdt_dev);
+ /*
+ * The firmware followed by U-Boot leaves the watchdog running
+ * with the default threshold which may vary. When we get here
+ * we should make a decision to prevent any side effects before
+ * user space daemon will take care of it. The best option,
+ * taking into consideration that there is no way to read values
+ * back from hardware, is to enforce watchdog being run with
+ * deterministic values.
+ */
+ ret = wdt_start(wdt_dev);
+ if (ret)
+ return ret;
+
+ /* Make sure the watchdog is serviced */
+ set_bit(WDOG_HW_RUNNING, &wdt_dev->status);
ret = devm_watchdog_register_device(&pdev->dev, wdt_dev);
if (ret) {