Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Sep 2015 16:38:26 +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-9@freebsd.org
Subject:   svn commit: r287434 - stable/9/sys/dev/ipmi
Message-ID:  <201509031638.t83GcQaE041914@repo.freebsd.org>

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

Log:
  MFC 248705,253812,253813:
  - Unlock IPMI sc while performing requests via KCS and SMIC interfaces.
  - empirical testing showed that 3 seconds is just too slow for GET_DEVICE_ID
    to return on newer Dell hardware.  Bump to 6 second timeouts until someone
    has a better idea on how to handle this
  - Check for ipmi_attached in ipmi_isa_probe as a suggested alternative to
    ipmi_isa_attach.  This keeps unintended but harmless noise about "ipmi1"
    from appearing in the boot up sequence.

Modified:
  stable/9/sys/dev/ipmi/ipmi_isa.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/9/sys/dev/ipmi/ipmi_isa.c
==============================================================================
--- stable/9/sys/dev/ipmi/ipmi_isa.c	Thu Sep  3 12:56:57 2015	(r287433)
+++ stable/9/sys/dev/ipmi/ipmi_isa.c	Thu Sep  3 16:38:26 2015	(r287434)
@@ -78,6 +78,14 @@ static int
 ipmi_isa_probe(device_t dev)
 {
 
+	/*
+	 * Give other drivers precedence.  Unfortunately, this doesn't
+	 * work if we have an SMBIOS table that duplicates a PCI device
+	 * that's later on the bus than the PCI-ISA bridge.
+	 */
+	if (ipmi_attached)
+		return (ENXIO);
+
 	/* Skip any PNP devices. */
 	if (isa_get_logicalid(dev) != 0)
 		return (ENXIO);
@@ -175,14 +183,6 @@ ipmi_isa_attach(device_t dev)
 	    !ipmi_hint_identify(dev, &info))
 		return (ENXIO);
 
-	/*
-	 * Give other drivers precedence.  Unfortunately, this doesn't
-	 * work if we have an SMBIOS table that duplicates a PCI device
-	 * that's later on the bus than the PCI-ISA bridge.
-	 */
-	if (ipmi_attached)
-		return (EBUSY);
-
 	switch (info.iface_type) {
 	case KCS_MODE:
 		count = 2;

Modified: stable/9/sys/dev/ipmi/ipmi_kcs.c
==============================================================================
--- stable/9/sys/dev/ipmi/ipmi_kcs.c	Thu Sep  3 12:56:57 2015	(r287433)
+++ stable/9/sys/dev/ipmi/ipmi_kcs.c	Thu Sep  3 16:38:26 2015	(r287434)
@@ -473,6 +473,7 @@ kcs_loop(void *arg)
 
 	IPMI_LOCK(sc);
 	while ((req = ipmi_dequeue_request(sc)) != NULL) {
+		IPMI_UNLOCK(sc);
 		ok = 0;
 		for (i = 0; i < 3 && !ok; i++)
 			ok = kcs_polled_request(sc, req);
@@ -480,6 +481,7 @@ kcs_loop(void *arg)
 			req->ir_error = 0;
 		else
 			req->ir_error = EIO;
+		IPMI_LOCK(sc);
 		ipmi_complete_request(sc, req);
 	}
 	IPMI_UNLOCK(sc);

Modified: stable/9/sys/dev/ipmi/ipmi_smic.c
==============================================================================
--- stable/9/sys/dev/ipmi/ipmi_smic.c	Thu Sep  3 12:56:57 2015	(r287433)
+++ stable/9/sys/dev/ipmi/ipmi_smic.c	Thu Sep  3 16:38:26 2015	(r287434)
@@ -362,6 +362,7 @@ smic_loop(void *arg)
 
 	IPMI_LOCK(sc);
 	while ((req = ipmi_dequeue_request(sc)) != NULL) {
+		IPMI_UNLOCK(sc);
 		ok = 0;
 		for (i = 0; i < 3 && !ok; i++) {
 			IPMI_IO_LOCK(sc);
@@ -372,6 +373,7 @@ smic_loop(void *arg)
 			req->ir_error = 0;
 		else
 			req->ir_error = EIO;
+		IPMI_LOCK(sc);
 		ipmi_complete_request(sc, req);
 	}
 	IPMI_UNLOCK(sc);

Modified: stable/9/sys/dev/ipmi/ipmivars.h
==============================================================================
--- stable/9/sys/dev/ipmi/ipmivars.h	Thu Sep  3 12:56:57 2015	(r287433)
+++ stable/9/sys/dev/ipmi/ipmivars.h	Thu Sep  3 16:38:26 2015	(r287434)
@@ -222,7 +222,7 @@ struct ipmi_ipmb {
 	((sc)->ipmi_io_res[1] != NULL ? OUTB_MULTIPLE(sc, x, value) :	\
 	    OUTB_SINGLE(sc, x, value))
 
-#define MAX_TIMEOUT 3 * hz
+#define MAX_TIMEOUT 6 * hz
 
 int	ipmi_attach(device_t);
 int	ipmi_detach(device_t);



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