Date: Tue, 22 Oct 2013 05:22:46 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256873 - head/sys/arm/allwinner Message-ID: <201310220522.r9M5Mk5b035461@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310220522.r9M5Mk5b035461>