Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: scan: Turn off unused power resources during initialization

It is reported that on certain platforms there are power resources
that are not associated with any devices physically present in the
platform. Those power resources are expected to be turned off by
the OS in accordance with the ACPI specification (section 7.3 of
ACPI 6.4) which currently is not done by Linux and that may lead
to obscure issues.

For instance, leaving those power resources in the "on" state may
prevent the platform from reaching the lowest power state in
suspend-to-idle which leads to excessive power draw.

For this reason, turn all of the unused ACPI power resources off
at the end of the initial namespace scan for devices in analogy with
resume from suspend-to-RAM.

Link: https://uefi.org/specs/ACPI/6.4/07_Power_and_Performance_Mgmt/device-power-management-objects.html
Reported-by: David Box <david.e.box@linux.intel.com>
Tested-by: Wendy Wang <wendy.wang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

+4 -2
+1
drivers/acpi/internal.h
··· 139 139 int acpi_power_get_inferred_state(struct acpi_device *device, int *state); 140 140 int acpi_power_on_resources(struct acpi_device *device, int state); 141 141 int acpi_power_transition(struct acpi_device *device, int state); 142 + void acpi_turn_off_unused_power_resources(void); 142 143 143 144 /* -------------------------------------------------------------------------- 144 145 Device Power Management
+1 -1
drivers/acpi/power.c
··· 996 996 997 997 mutex_unlock(&power_resource_list_lock); 998 998 } 999 + #endif 999 1000 1000 1001 void acpi_turn_off_unused_power_resources(void) 1001 1002 { ··· 1026 1025 1027 1026 mutex_unlock(&power_resource_list_lock); 1028 1027 } 1029 - #endif
+2
drivers/acpi/scan.c
··· 2360 2360 } 2361 2361 } 2362 2362 2363 + acpi_turn_off_unused_power_resources(); 2364 + 2363 2365 acpi_scan_initialized = true; 2364 2366 2365 2367 out:
-1
drivers/acpi/sleep.h
··· 8 8 extern struct mutex acpi_device_lock; 9 9 10 10 extern void acpi_resume_power_resources(void); 11 - extern void acpi_turn_off_unused_power_resources(void); 12 11 13 12 static inline acpi_status acpi_set_waking_vector(u32 wakeup_address) 14 13 {