Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jul 2013 14:05: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-8@freebsd.org
Subject:   svn commit: r253428 - stable/8/sys/dev/acpica
Message-ID:  <201307171405.r6HE5aSg005341@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Jul 17 14:05:35 2013
New Revision: 253428
URL: http://svnweb.freebsd.org/changeset/base/253428

Log:
  MFC 252576:
  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

Modified:
  stable/8/sys/dev/acpica/acpi_pcib.c
  stable/8/sys/dev/acpica/acpi_pcib_acpi.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/acpica/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi_pcib.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_pcib.c	Wed Jul 17 14:05:20 2013	(r253427)
+++ stable/8/sys/dev/acpica/acpi_pcib.c	Wed Jul 17 14:05:35 2013	(r253428)
@@ -134,15 +134,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: stable/8/sys/dev/acpica/acpi_pcib_acpi.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_pcib_acpi.c	Wed Jul 17 14:05:20 2013	(r253427)
+++ stable/8/sys/dev/acpica/acpi_pcib_acpi.c	Wed Jul 17 14:05:35 2013	(r253428)
@@ -164,6 +164,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.
      */
@@ -214,7 +220,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;



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