Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Aug 2012 12:40:32 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239128 - head/sys/dev/ipmi
Message-ID:  <201208071240.q77CeWKm062306@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Aug  7 12:40:31 2012
New Revision: 239128
URL: http://svn.freebsd.org/changeset/base/239128

Log:
  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

Modified:
  head/sys/dev/ipmi/ipmi.c
  head/sys/dev/ipmi/ipmivars.h

Modified: head/sys/dev/ipmi/ipmi.c
==============================================================================
--- head/sys/dev/ipmi/ipmi.c	Tue Aug  7 09:22:46 2012	(r239127)
+++ head/sys/dev/ipmi/ipmi.c	Tue Aug  7 12:40:31 2012	(r239128)
@@ -653,11 +653,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: head/sys/dev/ipmi/ipmivars.h
==============================================================================
--- head/sys/dev/ipmi/ipmivars.h	Tue Aug  7 09:22:46 2012	(r239127)
+++ head/sys/dev/ipmi/ipmivars.h	Tue Aug  7 12:40:31 2012	(r239128)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208071240.q77CeWKm062306>