svn commit: r239920 - stable/9/sys/dev/ipmi

John Baldwin jhb at FreeBSD.org
Thu Aug 30 20:42:43 UTC 2012


Author: jhb
Date: Thu Aug 30 20:42:42 2012
New Revision: 239920
URL: http://svn.freebsd.org/changeset/base/239920

Log:
  MFC 239128:
  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.

Modified:
  stable/9/sys/dev/ipmi/ipmi.c
  stable/9/sys/dev/ipmi/ipmivars.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/dev/ipmi/ipmi.c
==============================================================================
--- stable/9/sys/dev/ipmi/ipmi.c	Thu Aug 30 20:31:53 2012	(r239919)
+++ stable/9/sys/dev/ipmi/ipmi.c	Thu Aug 30 20:42:42 2012	(r239920)
@@ -652,11 +652,12 @@ ipmi_wd_event(void *arg, unsigned int cm
 		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;

Modified: stable/9/sys/dev/ipmi/ipmivars.h
==============================================================================
--- stable/9/sys/dev/ipmi/ipmivars.h	Thu Aug 30 20:31:53 2012	(r239919)
+++ stable/9/sys/dev/ipmi/ipmivars.h	Thu Aug 30 20:42:42 2012	(r239920)
@@ -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;


More information about the svn-src-stable mailing list