Skip to content

Commit 7e4fdea

Browse files
committed
ACPI: power: Turn off unused power resources unconditionally
According to the ACPI specification (section 7.2.2 in ACPI 6.4), the OS may evaluate the _OFF method of a power resource that is "off" already [1], and in particular that can be done in the case of unused power resources. Accordingly, modify acpi_turn_off_unused_power_resources() to evaluate the _OFF method for each of the unused power resources unconditionally which may help to work around BIOS issues where the return value of _STA for a power resource does not reflect the actual state of the power resource [2]. Link: https://uefi.org/specs/ACPI/6.4/07_Power_and_Performance_Mgmt/declaring-a-power-resource-object.html#off # [1] Link: https://lore.kernel.org/lkml/[email protected]/ # [2] Tested-by: Wendy Wang <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4b9ee77 commit 7e4fdea

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/acpi/power.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,18 +1005,9 @@ void acpi_turn_off_unused_power_resources(void)
10051005
mutex_lock(&power_resource_list_lock);
10061006

10071007
list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) {
1008-
int result, state;
1009-
10101008
mutex_lock(&resource->resource_lock);
10111009

1012-
result = acpi_power_get_state(resource->device.handle, &state);
1013-
if (result) {
1014-
mutex_unlock(&resource->resource_lock);
1015-
continue;
1016-
}
1017-
1018-
if (state == ACPI_POWER_RESOURCE_STATE_ON
1019-
&& !resource->ref_count) {
1010+
if (!resource->ref_count) {
10201011
dev_info(&resource->device.dev, "Turning OFF\n");
10211012
__acpi_power_off(resource);
10221013
}

0 commit comments

Comments
 (0)