svn commit: r256873 - head/sys/arm/allwinner
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Tue Oct 22 05:22:46 UTC 2013
Author: gonzo
Date: Tue Oct 22 05:22:46 2013
New Revision: 256873
URL: http://svnweb.freebsd.org/changeset/base/256873
Log:
Make watchdog function conform watchdog(9):
Set error to 0 when watchdog is armed and disable it when timeout
is too large to be set.
Modified:
head/sys/arm/allwinner/a10_wdog.c
Modified: head/sys/arm/allwinner/a10_wdog.c
==============================================================================
--- head/sys/arm/allwinner/a10_wdog.c Tue Oct 22 05:22:25 2013 (r256872)
+++ head/sys/arm/allwinner/a10_wdog.c Tue Oct 22 05:22:46 2013 (r256873)
@@ -150,6 +150,18 @@ a10wd_watchdog_fn(void *private, u_int c
(wd_intervals[i].value << WDOG_MODE_INTVL_SHIFT) |
WDOG_MODE_EN | WDOG_MODE_RST_EN);
WRITE(sc, WDOG_CTRL, WDOG_CTRL_RESTART);
+ *error = 0;
+ }
+ else {
+ /*
+ * Can't arm
+ * disable watchdog as watchdog(9) requires
+ */
+ device_printf(sc->dev,
+ "Can't arm, timeout is more than 16 sec\n");
+ mtx_unlock(&sc->mtx);
+ WRITE(sc, WDOG_MODE, 0);
+ return;
}
}
else
More information about the svn-src-all
mailing list