]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/watchdog/intel-mid_wdt.c
i2c: rephrase explanation of I2C_CLASS_DEPRECATED
[karo-tx-linux.git] / drivers / watchdog / intel-mid_wdt.c
index 45e4d02221b5849e1a3f61fa83d85b16bb8382d6..72c108a12c19d72d9958c71a62a315b8e3a4668a 100644 (file)
@@ -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) {