Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2015 16:56:24 +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: r281941 - head/sys/dev/ipmi
Message-ID:  <201504241656.t3OGuOA9093255@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Apr 24 16:56:23 2015
New Revision: 281941
URL: https://svnweb.freebsd.org/changeset/base/281941

Log:
  Watchdog drivers need to support rearming the watchdog in contexts which
  are not permitted to sleep.  Only use the IPMI watchdog with backends
  which poll driver-initiated requests to meet this requirement.
  
  In practice this means that watchdogs will no longer be used on systems
  that use the SSIF backend.
  
  Differential Revision:	https://reviews.freebsd.org/D2062
  MFC after:	2 weeks

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

Modified: head/sys/dev/ipmi/ipmi.c
==============================================================================
--- head/sys/dev/ipmi/ipmi.c	Fri Apr 24 16:20:56 2015	(r281940)
+++ head/sys/dev/ipmi/ipmi.c	Fri Apr 24 16:56:23 2015	(r281941)
@@ -756,17 +756,22 @@ ipmi_startup(void *arg)
 	}
 	device_printf(dev, "Number of channels %d\n", i);
 
-	/* probe for watchdog */
-	IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0),
-	    IPMI_GET_WDOG, 0, 0);
-
-	ipmi_submit_driver_request(sc, req, 0);
-
-	if (req->ir_compcode == 0x00) {
-		device_printf(dev, "Attached watchdog\n");
-		/* register the watchdog event handler */
-		sc->ipmi_watchdog_tag = EVENTHANDLER_REGISTER(watchdog_list,
-		    ipmi_wd_event, sc, 0);
+	/*
+	 * Probe for watchdog, but only for backends which support
+	 * polled driver requests.
+	 */
+	if (sc->ipmi_driver_requests_polled) {
+		IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0),
+		    IPMI_GET_WDOG, 0, 0);
+
+		ipmi_submit_driver_request(sc, req, 0);
+
+		if (req->ir_compcode == 0x00) {
+			device_printf(dev, "Attached watchdog\n");
+			/* register the watchdog event handler */
+			sc->ipmi_watchdog_tag = EVENTHANDLER_REGISTER(
+			    watchdog_list, ipmi_wd_event, sc, 0);
+		}
 	}
 
 	sc->ipmi_cdev = make_dev(&ipmi_cdevsw, device_get_unit(dev),

Modified: head/sys/dev/ipmi/ipmi_kcs.c
==============================================================================
--- head/sys/dev/ipmi/ipmi_kcs.c	Fri Apr 24 16:20:56 2015	(r281940)
+++ head/sys/dev/ipmi/ipmi_kcs.c	Fri Apr 24 16:56:23 2015	(r281941)
@@ -520,6 +520,7 @@ ipmi_kcs_attach(struct ipmi_softc *sc)
 	sc->ipmi_startup = kcs_startup;
 	sc->ipmi_enqueue_request = ipmi_polled_enqueue_request;
 	sc->ipmi_driver_request = kcs_driver_request;
+	sc->ipmi_driver_requests_polled = 1;
 
 	/* See if we can talk to the controller. */
 	status = INB(sc, KCS_CTL_STS);

Modified: head/sys/dev/ipmi/ipmi_smic.c
==============================================================================
--- head/sys/dev/ipmi/ipmi_smic.c	Fri Apr 24 16:20:56 2015	(r281940)
+++ head/sys/dev/ipmi/ipmi_smic.c	Fri Apr 24 16:56:23 2015	(r281941)
@@ -415,6 +415,7 @@ ipmi_smic_attach(struct ipmi_softc *sc)
 	sc->ipmi_startup = smic_startup;
 	sc->ipmi_enqueue_request = ipmi_polled_enqueue_request;
 	sc->ipmi_driver_request = smic_driver_request;
+	sc->ipmi_driver_requests_polled = 1;
 
 	/* See if we can talk to the controller. */
 	flags = INB(sc, SMIC_FLAGS);

Modified: head/sys/dev/ipmi/ipmivars.h
==============================================================================
--- head/sys/dev/ipmi/ipmivars.h	Fri Apr 24 16:20:56 2015	(r281940)
+++ head/sys/dev/ipmi/ipmivars.h	Fri Apr 24 16:56:23 2015	(r281941)
@@ -105,6 +105,7 @@ struct ipmi_softc {
 	int			ipmi_opened;
 	struct cdev		*ipmi_cdev;
 	TAILQ_HEAD(,ipmi_request) ipmi_pending_requests;
+	int			ipmi_driver_requests_polled;
 	eventhandler_tag	ipmi_watchdog_tag;
 	int			ipmi_watchdog_active;
 	struct intr_config_hook	ipmi_ich;



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