diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index a446ea8f0525..0f705dbb062d 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1685,14 +1685,14 @@ acpi_probe_order(ACPI_HANDLE handle, int *order) * 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; } /* diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index bbbd23926c2c..06c295481322 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -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.