From owner-svn-src-all@FreeBSD.ORG Thu Mar 11 08:55:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EC2C10656E3; Thu, 11 Mar 2010 08:55:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67A3E8FC21; Thu, 11 Mar 2010 08:55:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2B8t4Ql020467; Thu, 11 Mar 2010 08:55:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B8t3sE020466; Thu, 11 Mar 2010 08:55:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201003110855.o2B8t3sE020466@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Mar 2010 08:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205006 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2010 08:55:04 -0000 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.