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.
This commit is contained in:
parent
00b1705bdc
commit
5ad43f4b9a
@ -150,6 +150,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
|
||||
|
Loading…
x
Reference in New Issue
Block a user