Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Sep 2015 16:43:36 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r287435 - in stable: 10/sys/dev/ipmi 9/sys/dev/ipmi
Message-ID:  <201509031643.t83GhaH2045857@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Sep  3 16:43:35 2015
New Revision: 287435
URL: https://svnweb.freebsd.org/changeset/base/287435

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

Modified:
  stable/10/sys/dev/ipmi/ipmi.c
  stable/10/sys/dev/ipmi/ipmi_kcs.c
  stable/10/sys/dev/ipmi/ipmi_smic.c
  stable/10/sys/dev/ipmi/ipmivars.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/sys/dev/ipmi/ipmi.c
  stable/9/sys/dev/ipmi/ipmi_kcs.c
  stable/9/sys/dev/ipmi/ipmi_smic.c
  stable/9/sys/dev/ipmi/ipmivars.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/10/sys/dev/ipmi/ipmi.c
==============================================================================
--- stable/10/sys/dev/ipmi/ipmi.c	Thu Sep  3 16:38:26 2015	(r287434)
+++ stable/10/sys/dev/ipmi/ipmi.c	Thu Sep  3 16:43:35 2015	(r287435)
@@ -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: stable/10/sys/dev/ipmi/ipmi_kcs.c
==============================================================================
--- stable/10/sys/dev/ipmi/ipmi_kcs.c	Thu Sep  3 16:38:26 2015	(r287434)
+++ stable/10/sys/dev/ipmi/ipmi_kcs.c	Thu Sep  3 16:43:35 2015	(r287435)
@@ -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: stable/10/sys/dev/ipmi/ipmi_smic.c
==============================================================================
--- stable/10/sys/dev/ipmi/ipmi_smic.c	Thu Sep  3 16:38:26 2015	(r287434)
+++ stable/10/sys/dev/ipmi/ipmi_smic.c	Thu Sep  3 16:43:35 2015	(r287435)
@@ -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: stable/10/sys/dev/ipmi/ipmivars.h
==============================================================================
--- stable/10/sys/dev/ipmi/ipmivars.h	Thu Sep  3 16:38:26 2015	(r287434)
+++ stable/10/sys/dev/ipmi/ipmivars.h	Thu Sep  3 16:43:35 2015	(r287435)
@@ -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?201509031643.t83GhaH2045857>