aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ipmi
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2012-08-07 12:40:31 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2012-08-07 12:40:31 +0000
commit1710852ebd263899255baed1b12f44cae5bf23fa (patch)
treed310aff5128205757cfb0c6ce4eabf65fbc7459a /sys/dev/ipmi
parent06f2b92916e509e1eed317e90cbf00eb97baf1b8 (diff)
downloadsrc-1710852ebd263899255baed1b12f44cae5bf23fa.tar.gz
src-1710852ebd263899255baed1b12f44cae5bf23fa.zip
Don't try to stop the IPMI watchdog timer if it is not running.
Starting or stopping the IPMI watchdog is rather expensive with the current implementation as all IPMI requests are bounced via thread. This is not viable during shutdown or dumps, and this avoids headache in the common case that the watchdog is not enabled. The IPMI watchdog should probably be reworked to not use a separate thread to fix this in the case when the watchdog timer is enabled. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=239128
Diffstat (limited to 'sys/dev/ipmi')
-rw-r--r--sys/dev/ipmi/ipmi.c7
-rw-r--r--sys/dev/ipmi/ipmivars.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c
index 6b7d46469237..c42805de35aa 100644
--- a/sys/dev/ipmi/ipmi.c
+++ b/sys/dev/ipmi/ipmi.c
@@ -653,11 +653,12 @@ ipmi_wd_event(void *arg, unsigned int cmd, int *error)
if (timeout == 0)
timeout = 1;
e = ipmi_set_watchdog(sc, timeout);
- if (e == 0)
+ if (e == 0) {
*error = 0;
- else
+ sc->ipmi_watchdog_active = 1;
+ } else
(void)ipmi_set_watchdog(sc, 0);
- } else {
+ } else if (atomic_readandclear_int(&sc->ipmi_watchdog_active) != 0) {
e = ipmi_set_watchdog(sc, 0);
if (e != 0 && cmd == 0)
*error = EOPNOTSUPP;
diff --git a/sys/dev/ipmi/ipmivars.h b/sys/dev/ipmi/ipmivars.h
index 79d61f61041e..614c6be36046 100644
--- a/sys/dev/ipmi/ipmivars.h
+++ b/sys/dev/ipmi/ipmivars.h
@@ -105,6 +105,7 @@ struct ipmi_softc {
struct cdev *ipmi_cdev;
TAILQ_HEAD(,ipmi_request) ipmi_pending_requests;
eventhandler_tag ipmi_watchdog_tag;
+ int ipmi_watchdog_active;
struct intr_config_hook ipmi_ich;
struct mtx ipmi_lock;
struct cv ipmi_request_added;