From owner-svn-src-stable@freebsd.org Thu Sep 3 16:38:27 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFD829C97BA; Thu, 3 Sep 2015 16:38:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C044C891; Thu, 3 Sep 2015 16:38:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83GcRdl041918; Thu, 3 Sep 2015 16:38:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83GcQaE041914; Thu, 3 Sep 2015 16:38:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509031638.t83GcQaE041914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Sep 2015 16:38:26 +0000 (UTC) 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 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2015 16:38:28 -0000 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);