- Give all clocks and timers on acpi0 the equal probing order.
- Increase probing order for ECDT table to match HID-based probing. - Decrease probing order for HPET table to match HID-based probing. - Decrease probing order for CPUs and system resources. - Fix ACPI_DEV_BASE_ORDER to reflect the reality.
This commit is contained in:
parent
19c87af0fd
commit
404b0d10ae
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=231161
@ -1812,23 +1812,29 @@ acpi_probe_children(device_t bus)
|
||||
static void
|
||||
acpi_probe_order(ACPI_HANDLE handle, int *order)
|
||||
{
|
||||
ACPI_OBJECT_TYPE type;
|
||||
ACPI_OBJECT_TYPE type;
|
||||
|
||||
/*
|
||||
* 1. CPUs
|
||||
* 2. I/O port and memory system resource holders
|
||||
* 3. Embedded controllers (to handle early accesses)
|
||||
* 4. PCI Link Devices
|
||||
*/
|
||||
AcpiGetType(handle, &type);
|
||||
if (type == ACPI_TYPE_PROCESSOR)
|
||||
*order = 1;
|
||||
else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02"))
|
||||
*order = 2;
|
||||
else if (acpi_MatchHid(handle, "PNP0C09"))
|
||||
*order = 3;
|
||||
else if (acpi_MatchHid(handle, "PNP0C0F"))
|
||||
*order = 4;
|
||||
/*
|
||||
* 0. CPUs
|
||||
* 1. I/O port and memory system resource holders
|
||||
* 2. Clocks and timers (to handle early accesses)
|
||||
* 3. Embedded controllers (to handle early accesses)
|
||||
* 4. PCI Link Devices
|
||||
*/
|
||||
AcpiGetType(handle, &type);
|
||||
if (type == ACPI_TYPE_PROCESSOR)
|
||||
*order = 0;
|
||||
else if (acpi_MatchHid(handle, "PNP0C01") ||
|
||||
acpi_MatchHid(handle, "PNP0C02"))
|
||||
*order = 1;
|
||||
else if (acpi_MatchHid(handle, "PNP0100") ||
|
||||
acpi_MatchHid(handle, "PNP0103") ||
|
||||
acpi_MatchHid(handle, "PNP0B00"))
|
||||
*order = 2;
|
||||
else if (acpi_MatchHid(handle, "PNP0C09"))
|
||||
*order = 3;
|
||||
else if (acpi_MatchHid(handle, "PNP0C0F"))
|
||||
*order = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1889,7 +1895,7 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
|
||||
* resources).
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str));
|
||||
order = level * 10 + 100;
|
||||
order = level * 10 + ACPI_DEV_BASE_ORDER;
|
||||
acpi_probe_order(handle, &order);
|
||||
child = BUS_ADD_CHILD(bus, order, NULL, -1);
|
||||
if (child == NULL)
|
||||
|
@ -295,7 +295,7 @@ acpi_ec_ecdt_probe(device_t parent)
|
||||
}
|
||||
|
||||
/* Create the child device with the given unit number. */
|
||||
child = BUS_ADD_CHILD(parent, 0, "acpi_ec", ecdt->Uid);
|
||||
child = BUS_ADD_CHILD(parent, 3, "acpi_ec", ecdt->Uid);
|
||||
if (child == NULL) {
|
||||
printf("%s: can't add child\n", __func__);
|
||||
return;
|
||||
|
@ -342,7 +342,7 @@ hpet_identify(driver_t *driver, device_t parent)
|
||||
if (found)
|
||||
continue;
|
||||
/* If not - create it from table info. */
|
||||
child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "hpet", 0);
|
||||
child = BUS_ADD_CHILD(parent, 2, "hpet", 0);
|
||||
if (child == NULL) {
|
||||
printf("%s: can't add child\n", __func__);
|
||||
continue;
|
||||
|
@ -124,7 +124,7 @@ acpi_timer_identify(driver_t *driver, device_t parent)
|
||||
acpi_timer_dev)
|
||||
return_VOID;
|
||||
|
||||
if ((dev = BUS_ADD_CHILD(parent, 0, "acpi_timer", 0)) == NULL) {
|
||||
if ((dev = BUS_ADD_CHILD(parent, 2, "acpi_timer", 0)) == NULL) {
|
||||
device_printf(parent, "could not add acpi_timer0\n");
|
||||
return_VOID;
|
||||
}
|
||||
|
@ -473,7 +473,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj);
|
||||
* probe order sorted so that things like sysresource are available before
|
||||
* their children need them.
|
||||
*/
|
||||
#define ACPI_DEV_BASE_ORDER 10
|
||||
#define ACPI_DEV_BASE_ORDER 100
|
||||
|
||||
/* Default maximum number of tasks to enqueue. */
|
||||
#ifndef ACPI_MAX_TASKS
|
||||
|
Loading…
Reference in New Issue
Block a user