watchdog: tegra: Stop watchdog first if restarting
authorAndrew Chew <achew@nvidia.com>
Tue, 10 Nov 2015 00:11:38 +0000 (16:11 -0800)
committerWim Van Sebroeck <wim@iguana.be>
Mon, 23 Nov 2015 07:59:45 +0000 (08:59 +0100)
If we need to restart the watchdog due to someone changing the timeout
interval, stop the watchdog before restarting it.  Otherwise, the new
timeout doesn't seem to take.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/tegra_wdt.c

index 7f97cdd53f29624f6c732b0e44c0448a856c8a5c..9ec57608da82931e6f2a913246825ff9be11e034 100644 (file)
@@ -140,8 +140,10 @@ static int tegra_wdt_set_timeout(struct watchdog_device *wdd,
 {
        wdd->timeout = timeout;
 
-       if (watchdog_active(wdd))
+       if (watchdog_active(wdd)) {
+               tegra_wdt_stop(wdd);
                return tegra_wdt_start(wdd);
+       }
 
        return 0;
 }