aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ichwd/ichwd.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2011-09-02 17:06:50 +0000
committerXin LI <delphij@FreeBSD.org>2011-09-02 17:06:50 +0000
commitcdd4eea9fca2d4b2edd85e3c29413ab9b0deaa46 (patch)
treeefa92807876c5fbff852ce2fa79cbbb0c8071052 /sys/dev/ichwd/ichwd.c
parentd1f97f76a596d948f6e61cc0dd67c8a96220ec29 (diff)
downloadsrc-cdd4eea9fca2d4b2edd85e3c29413ab9b0deaa46.tar.gz
src-cdd4eea9fca2d4b2edd85e3c29413ab9b0deaa46.zip
Fix a bug in ichwd(4) which prevents it from beig enabled if the new
timeout is the same timeout. Submitted by: Dmitrij Tejblum <tejblum yandex-team.ru> PR: kern/139604 MFC after: 2 weeks Approved by: re (kib)
Notes
Notes: svn path=/head/; revision=225340
Diffstat (limited to 'sys/dev/ichwd/ichwd.c')
-rw-r--r--sys/dev/ichwd/ichwd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c
index a66826e4c6e4..5d800c963e86 100644
--- a/sys/dev/ichwd/ichwd.c
+++ b/sys/dev/ichwd/ichwd.c
@@ -402,11 +402,10 @@ ichwd_event(void *arg, unsigned int cmd, int *error)
cmd &= WD_INTERVAL;
timeout = ((uint64_t)1 << cmd) / ICHWD_TICK;
if (cmd) {
- if (timeout != sc->timeout) {
- if (!sc->active)
- ichwd_tmr_enable(sc);
+ if (!sc->active)
+ ichwd_tmr_enable(sc);
+ if (timeout != sc->timeout)
ichwd_tmr_set(sc, timeout);
- }
ichwd_tmr_reload(sc);
*error = 0;
} else {