summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-05-18 16:03:34 +0000
committerian <ian@FreeBSD.org>2014-05-18 16:03:34 +0000
commitde4ccf451cbf43085aaee05881ee5548bdb403a9 (patch)
treee07cb3971062b826a5f8e230b99f5c822105f453
parentde651b30e730164993d4fa41093184fac17ca6c7 (diff)
downloadFreeBSD-src-de4ccf451cbf43085aaee05881ee5548bdb403a9.zip
FreeBSD-src-de4ccf451cbf43085aaee05881ee5548bdb403a9.tar.gz
MFC 256873: Make watchdog function conform watchdog(9):
-rw-r--r--sys/arm/allwinner/a10_wdog.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/arm/allwinner/a10_wdog.c b/sys/arm/allwinner/a10_wdog.c
index a5af52d..af7365b 100644
--- a/sys/arm/allwinner/a10_wdog.c
+++ b/sys/arm/allwinner/a10_wdog.c
@@ -153,6 +153,18 @@ a10wd_watchdog_fn(void *private, u_int cmd, int *error)
(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
OpenPOWER on IntegriCloud