Skip to content

Commit bc28368

Browse files
committed
ACPI: PM: Do not turn off power resources in unknown state
Commit 6381195 ("ACPI: power: Rework turning off unused power resources") caused power resources in unknown state with reference counters equal to zero to be turned off too, but that caused issues to appear in the field, so modify the code to only turn off power resources that are known to be "on". Link: https://lore.kernel.org/linux-acpi/[email protected]/ Fixes: 6381195 ("ACPI: power: Rework turning off unused power resources") Reported-by: Andreas K. Huettel <[email protected]> Tested-by: Andreas K. Huettel <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Cc: 5.14+ <[email protected]> # 5.14+
1 parent 519d819 commit bc28368

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/acpi/power.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,13 +1035,8 @@ void acpi_turn_off_unused_power_resources(void)
10351035
list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) {
10361036
mutex_lock(&resource->resource_lock);
10371037

1038-
/*
1039-
* Turn off power resources in an unknown state too, because the
1040-
* platform firmware on some system expects the OS to turn off
1041-
* power resources without any users unconditionally.
1042-
*/
10431038
if (!resource->ref_count &&
1044-
resource->state != ACPI_POWER_RESOURCE_STATE_OFF) {
1039+
resource->state == ACPI_POWER_RESOURCE_STATE_ON) {
10451040
acpi_handle_debug(resource->device.handle, "Turning OFF\n");
10461041
__acpi_power_off(resource);
10471042
}

0 commit comments

Comments
 (0)