From owner-svn-src-head@FreeBSD.ORG Wed Jul 3 17:26:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1BB35C87; Wed, 3 Jul 2013 17:26:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EA22D1A16; Wed, 3 Jul 2013 17:26:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63HQ5dt048684; Wed, 3 Jul 2013 17:26:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63HQ5rQ048682; Wed, 3 Jul 2013 17:26:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201307031726.r63HQ5rQ048682@svn.freebsd.org> From: John Baldwin Date: Wed, 3 Jul 2013 17:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252576 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 17:26:06 -0000 Author: jhb Date: Wed Jul 3 17:26:05 2013 New Revision: 252576 URL: http://svnweb.freebsd.org/changeset/base/252576 Log: Don't perform the acpi_DeviceIsPresent() check for PCI-PCI bridges. If we are probing a PCI-PCI bridge it is because we found one by enumerating the devices on a PCI bus, so the bridge is definitely present. A few BIOSes report incorrect status (_STA) for some bridges that claimed they were not present when in fact they were. While here, move this check earlier for Host-PCI bridges so attach fails before doing any work that needs to be torn down. PR: kern/91594 Tested by: Jack Vogel @ Intel MFC after: 1 week Modified: head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_pcib_acpi.c Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Wed Jul 3 17:23:51 2013 (r252575) +++ head/sys/dev/acpica/acpi_pcib.c Wed Jul 3 17:26:05 2013 (r252576) @@ -135,15 +135,6 @@ acpi_pcib_attach(device_t dev, ACPI_BUFF ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); /* - * Don't attach if we're not really there. - * - * XXX: This isn't entirely correct since we may be a PCI bus - * on a hot-plug docking station, etc. - */ - if (!acpi_DeviceIsPresent(dev)) - return_VALUE(ENXIO); - - /* * Get the PCI interrupt routing table for this bus. If we can't * get it, this is not an error but may reduce functionality. There * are several valid bridges in the field that do not have a _PRT, so Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jul 3 17:23:51 2013 (r252575) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jul 3 17:26:05 2013 (r252576) @@ -287,6 +287,12 @@ acpi_pcib_acpi_attach(device_t dev) sc->ap_handle = acpi_get_handle(dev); /* + * Don't attach if we're not really there. + */ + if (!acpi_DeviceIsPresent(dev)) + return (ENXIO); + + /* * Get our segment number by evaluating _SEG. * It's OK for this to not exist. */ @@ -353,7 +359,7 @@ acpi_pcib_acpi_attach(device_t dev) if (status != AE_NOT_FOUND) { device_printf(dev, "could not evaluate _BBN - %s\n", AcpiFormatException(status)); - return_VALUE (ENXIO); + return (ENXIO); } else { /* If it's not found, assume 0. */ sc->ap_bus = 0;