Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Mar 2010 08:55:03 +0000 (UTC)
From:      Andriy Gapon <avg@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: r205006 - stable/8/sys/dev/acpica
Message-ID:  <201003110855.o2B8t3sE020466@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Mar 11 08:55:03 2010
New Revision: 205006
URL: http://svn.freebsd.org/changeset/base/205006

Log:
  MFC r203776: acpi cpu: probe+attach before all other enumerated children
  
  X-MFCto7 after:	1 week

Modified:
  stable/8/sys/dev/acpica/acpi.c
  stable/8/sys/dev/acpica/acpi_cpu.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi.c	Thu Mar 11 08:33:39 2010	(r205005)
+++ stable/8/sys/dev/acpica/acpi.c	Thu Mar 11 08:55:03 2010	(r205006)
@@ -1691,14 +1691,14 @@ acpi_probe_order(ACPI_HANDLE handle, int
      * 100000. CPUs
      */
     AcpiGetType(handle, &type);
-    if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02"))
+    if (type == ACPI_TYPE_PROCESSOR)
 	*order = 1;
-    else if (acpi_MatchHid(handle, "PNP0C09"))
+    else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02"))
 	*order = 2;
-    else if (acpi_MatchHid(handle, "PNP0C0F"))
+    else if (acpi_MatchHid(handle, "PNP0C09"))
 	*order = 3;
-    else if (type == ACPI_TYPE_PROCESSOR)
-	*order = 100000;
+    else if (acpi_MatchHid(handle, "PNP0C0F"))
+	*order = 4;
 }
 
 /*

Modified: stable/8/sys/dev/acpica/acpi_cpu.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_cpu.c	Thu Mar 11 08:33:39 2010	(r205005)
+++ stable/8/sys/dev/acpica/acpi_cpu.c	Thu Mar 11 08:55:03 2010	(r205006)
@@ -384,13 +384,31 @@ acpi_cpu_attach(device_t dev)
     /* Probe for Cx state support. */
     acpi_cpu_cx_probe(sc);
 
-    /* Finally,  call identify and probe/attach for child devices. */
-    bus_generic_probe(dev);
-    bus_generic_attach(dev);
-
     return (0);
 }
 
+static void
+acpi_cpu_postattach(void *unused __unused)
+{
+    device_t *devices;
+    int err;
+    int i, n;
+
+    err = devclass_get_devices(acpi_cpu_devclass, &devices, &n);
+    if (err != 0) {
+	printf("devclass_get_devices(acpi_cpu_devclass) failed\n");
+	return;
+    }
+    for (i = 0; i < n; i++)
+	bus_generic_probe(devices[i]);
+    for (i = 0; i < n; i++)
+	bus_generic_attach(devices[i]);
+    free(devices, M_TEMP);
+}
+
+SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE,
+    acpi_cpu_postattach, NULL);
+
 /*
  * Disable any entry to the idle function during suspend and re-enable it
  * during resume.



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