mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
MFC r203776: acpi cpu: probe+attach before all other enumerated children
X-MFCto7 after: 1 week
This commit is contained in:
parent
060d3bde04
commit
57ff35ce74
2 changed files with 27 additions and 9 deletions
|
|
@ -1691,14 +1691,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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue