diff options
author | Warner Losh <imp@FreeBSD.org> | 2017-03-01 05:18:43 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2017-03-01 05:18:43 +0000 |
commit | 9417c448f81272a975d93043a88588ff5a625c14 (patch) | |
tree | c98fbb2fbe7b7c5ee8d432c4b226d18e2dfe60ab /sys/dev | |
parent | 51abf0d5e3ca08242334167a07ad9ad3841adf3a (diff) | |
download | src-9417c448f81272a975d93043a88588ff5a625c14.tar.gz src-9417c448f81272a975d93043a88588ff5a625c14.zip |
Fixed TCO v3 tick convert
TCO v3's internal timer is stored as seconds.
Submitted by: Denir Li <denir-li@users.noreply.github.com>
Pull Request: https://github.com/freebsd/freebsd/pull/51
Pull Request: https://github.com/freebsd/freebsd/pull/52
Notes
Notes:
svn path=/head/; revision=314477
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ichwd/ichwd.c | 8 | ||||
-rw-r--r-- | sys/dev/ichwd/ichwd.h | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c index 75c41b74e31b..42f330d17200 100644 --- a/sys/dev/ichwd/ichwd.c +++ b/sys/dev/ichwd/ichwd.c @@ -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); diff --git a/sys/dev/ichwd/ichwd.h b/sys/dev/ichwd/ichwd.h index dc24a9d605ce..33ae66c7bc8a 100644 --- a/sys/dev/ichwd/ichwd.h +++ b/sys/dev/ichwd/ichwd.h @@ -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 |