From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 20:43:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE4001065679; Thu, 30 Aug 2012 20:43:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904328FC17; Thu, 30 Aug 2012 20:43:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UKh1XM011019; Thu, 30 Aug 2012 20:43:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UKh1tn011016; Thu, 30 Aug 2012 20:43:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208302043.q7UKh1tn011016@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239921 - stable/8/sys/dev/ipmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 20:43:01 -0000 Author: jhb Date: Thu Aug 30 20:43:01 2012 New Revision: 239921 URL: http://svn.freebsd.org/changeset/base/239921 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/8/sys/dev/ipmi/ipmi.c stable/8/sys/dev/ipmi/ipmivars.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/8/sys/dev/ipmi/ipmi.c Thu Aug 30 20:42:42 2012 (r239920) +++ stable/8/sys/dev/ipmi/ipmi.c Thu Aug 30 20:43:01 2012 (r239921) @@ -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/8/sys/dev/ipmi/ipmivars.h ============================================================================== --- stable/8/sys/dev/ipmi/ipmivars.h Thu Aug 30 20:42:42 2012 (r239920) +++ stable/8/sys/dev/ipmi/ipmivars.h Thu Aug 30 20:43:01 2012 (r239921) @@ -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;