Date: Sun, 17 Sep 2017 10:43:27 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r323672 - stable/11/sys/dev/ichwd Message-ID: <201709171043.v8HAhRn0096126@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Sep 17 10:43:27 2017 New Revision: 323672 URL: https://svnweb.freebsd.org/changeset/base/323672 Log: MFC r314477 (by imp): Fix TCO v3 tick convert. Modified: stable/11/sys/dev/ichwd/ichwd.c stable/11/sys/dev/ichwd/ichwd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/11/sys/dev/ichwd/ichwd.c Sun Sep 17 10:28:45 2017 (r323671) +++ stable/11/sys/dev/ichwd/ichwd.c Sun Sep 17 10:43:27 2017 (r323672) @@ -512,7 +512,13 @@ ichwd_event(void *arg, unsigned int cmd, int *error) /* convert from power-of-two-ns to WDT ticks */ cmd &= WD_INTERVAL; - timeout = ((uint64_t)1 << cmd) / ICHWD_TICK; + + if (sc->tco_version == 3) { + timeout = ((uint64_t)1 << cmd) / ICHWD_TCO_V3_TICK; + } else { + timeout = ((uint64_t)1 << cmd) / ICHWD_TICK; + } + if (cmd) { if (!sc->active) ichwd_tmr_enable(sc); Modified: stable/11/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/11/sys/dev/ichwd/ichwd.h Sun Sep 17 10:28:45 2017 (r323671) +++ stable/11/sys/dev/ichwd/ichwd.h Sun Sep 17 10:43:27 2017 (r323672) @@ -345,7 +345,9 @@ struct ichwd_softc { #define TCO_RLD1_TMR_MAX 0x003f #define TCO_RLD2_TMR_MAX 0x03ff -/* approximate length in nanoseconds of one WDT tick (about 0.6 sec) */ +/* approximate length in nanoseconds of one WDT tick (about 0.6 sec) for TCO v1/v2 */ #define ICHWD_TICK 600000000 +/* approximate length in nanoseconds of one WDT tick (about 1.0 sec) for TCO v3 */ +#define ICHWD_TCO_V3_TICK 1000000000 #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709171043.v8HAhRn0096126>