Revert "ACPI: scan: Defer device power initialization"

Revert commit dc948f8b38 ("ACPI: scan: Defer device power
initialization") that is incomplete and may cause ACPI power
management of devices to fail.

The problem is that PCI devices are associated with the
corresponding ACPI device objects before acpi_bus_attach()
runs for them, so after commit dc948f8b38, ACPI power
management will not be initialized for them before making
that association.  Consequently, the reference counting of
ACPI power resources may not work as expected going forward
and power management issues may appear.  If they appear, they
may be elusive and hard to diagnose.

While this is fixable, I am not sure if fixing it on top of
commit dc948f8b38 is the best way to go, so it is better to
revert that commit for now and revisit the whole thing in the
next cycle.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/6029658.DvuYhMxLoT@rafael.j.wysocki
This commit is contained in:
Rafael J. Wysocki
2026-08-27 15:59:32 +02:00
parent 3382bfbca5
commit 3b446d169a
2 changed files with 4 additions and 1 deletions

View File

@@ -954,7 +954,6 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle)
INIT_LIST_HEAD(&resource->list_node);
INIT_LIST_HEAD(&resource->dependents);
device->power.state = ACPI_STATE_UNKNOWN;
device->flags.initialized = true;
/* Evaluate the object to get the system level and resource order. */
status = acpi_evaluate_object(handle, NULL, NULL, &buffer);

View File

@@ -1144,6 +1144,9 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
if (!list_empty(&device->power.states[ACPI_STATE_D3_HOT].resources))
device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
}
if (acpi_bus_init_power(device))
device->flags.power_manageable = 0;
}
static void acpi_bus_get_flags(struct acpi_device *device)
@@ -1825,6 +1828,7 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
acpi_set_pnp_ids(handle, &device->pnp, type);
acpi_init_properties(device);
acpi_bus_get_flags(device);
device->flags.initialized = true;
device->flags.enumeration_by_parent =
acpi_device_enumeration_by_parent(device);
acpi_device_clear_enumerated(device);