linux/drivers/acpi
Rafael J. Wysocki f850a48a07 ACPI: PM: Allow transitions to D0 to occur in special cases
If a device with ACPI PM is left in D0 during a system-wide
transition to the S3 (suspend-to-RAM) or S4 (hibernation) sleep
state, the actual state of the device need not be D0 during resume
from it, although its power.state value will still reflect D0 (that
is, the power state from before the system-wide transition).

In that case, the acpi_device_set_power() call made to ensure that
the power state of the device will be D0 going forward has no effect,
because the new state (D0) is equal to the one reflected by the
device's power.state value.  That does not affect power resources,
which are taken care of by acpi_resume_power_resources() called from
acpi_pm_finish() during resume from system-wide sleep states, but it
still may be necessary to invoke _PS0 for the device on top of that
in order to finalize its transition to D0.

For this reason, modify acpi_device_set_power() to allow transitions
to D0 to occur even if D0 is the current power state of the device
according to its power.state value.

That will not affect power resources, which are assumed to be in
the right configuration already (as reflected by the current values
of their reference counters), but it may cause _PS0 to be evaluated
for the device.  However, evaluating _PS0 for a device already in D0
may lead to confusion in general, so invoke _PSC (if present) to
check the device's current power state upfront and only evaluate
_PS0 for it if _PSC has returned a power state different from D0.
[If _PSC is not present or the evaluation of it fails, the power
state of the device is assumed to be D0 at this point.]

Fixes: 20dacb71ad (ACPI / PM: Rework device power management to follow ACPI 6)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2019-06-27 12:30:00 +02:00
..
acpica Merge branch 'acpica' 2019-05-06 10:49:01 +02:00
apei Merge branch 'acpi-apei' 2019-03-04 11:16:35 +01:00
arm64 Second round of arm64 fixes for -rc2 2019-05-24 11:03:26 -07:00
dptf treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
hmat treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
nfit treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
pmic Linux 5.0-rc7 2019-02-18 13:27:15 +10:00
x86 ACPI / x86: Make PWM2 device always present at Lenovo Yoga Book 2019-02-15 00:19:58 +01:00
ac.c
acpi_adxl.c ACPI/ADXL: Add address translation interface using an ACPI DSM 2018-10-16 10:03:00 +02:00
acpi_amba.c
acpi_apd.c clk: Remove io.h from clk-provider.h 2019-05-15 13:21:37 -07:00
acpi_cmos_rtc.c
acpi_configfs.c ACPICA: Rename nameseg length macro/define for clarity 2019-04-09 11:24:48 +02:00
acpi_dbg.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
acpi_extlog.c
acpi_ipmi.c acpi:ipmi: Convert ipmi_user_t to struct ipmi_user * 2018-09-18 16:15:33 -05:00
acpi_lpat.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
acpi_lpit.c ACPI / LPIT: Correct LPIT end address for lpit_process() 2019-05-28 19:30:27 +02:00
acpi_lpss.c ACPI / LPSS: Use acpi_lpss_* instead of acpi_subsys_* functions for hibernate 2019-04-18 16:46:45 +02:00
acpi_memhotplug.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 12 2019-05-21 11:28:45 +02:00
acpi_pad.c ACPI: Add Hygon Dhyana support 2018-09-27 18:29:00 +02:00
acpi_platform.c ACPI / platform: Add SMB0001 HID to forbidden_id_list 2018-11-21 13:30:13 +01:00
acpi_pnp.c
acpi_processor.c ACPI / processor: Fix the return value of acpi_processor_ids_walk() 2018-10-04 08:58:32 +02:00
acpi_tad.c ACPI: TAD: Add low-level support for real time capability 2018-10-18 09:11:53 +02:00
acpi_video.c ACPI / video: Extend chassis-type detection with a "Lunch Box" check 2019-02-13 23:38:34 +01:00
acpi_watchdog.c
battery.c ACPI / battery: Do not export energy_full[_design] on devices without full_charge_capacity 2018-08-09 10:49:35 +02:00
bgrt.c
blacklist.c
bus.c ACPI: use different default debug value than ACPICA 2019-03-25 10:45:59 +01:00
button.c ACPI: button: reinitialize button state upon resume 2019-04-12 10:29:01 +02:00
cm_sbs.c
container.c
cppc_acpi.c Merge branches 'acpi-scan', 'acpi-tables', 'acpi-misc' and 'acpi-pm' 2019-05-06 10:49:39 +02:00
custom_method.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
debugfs.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
device_pm.c ACPI: PM: Allow transitions to D0 to occur in special cases 2019-06-27 12:30:00 +02:00
device_sysfs.c ACPI: bus: change _ADR representation to 64 bits 2019-05-10 12:30:45 +02:00
dock.c
ec_sys.c ACPI: no need to check return value of debugfs_create functions 2019-01-22 19:45:52 +01:00
ec.c Revert "ACPI / EC: Remove old CLEAR_ON_RESUME quirk" 2019-02-01 12:56:49 +01:00
event.c ACPI: event: replace strcpy() by strscpy() 2019-04-23 10:54:26 +02:00
evged.c
fan.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
glue.c ACPI / glue: Add acpi_platform_notify() function 2018-11-26 18:19:11 +01:00
hed.c
internal.h ACPI: EC: Clean up probing for early EC 2019-01-29 11:01:30 +01:00
ioapic.c
irq.c ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting 2019-02-24 21:12:01 +01:00
Kconfig acpi/hmat: Parse and report heterogeneous memory 2019-04-04 18:41:20 +02:00
Makefile acpi/hmat: Parse and report heterogeneous memory 2019-04-04 18:41:20 +02:00
numa.c acpi: Create subtable parsing infrastructure 2019-04-04 18:41:12 +02:00
nvs.c
osi.c ACPI / OSI: Add OEM _OSI string to enable dGPU direct output 2018-12-18 11:06:05 +01:00
osl.c ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset 2018-12-20 10:19:49 +01:00
pci_irq.c
pci_link.c ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting 2019-02-24 21:12:01 +01:00
pci_mcfg.c PCI: al: Add Amazon Annapurna Labs PCIe host controller driver 2019-04-25 16:33:07 -05:00
pci_root.c PCI/ACPI: Advertise _HPX Type 3 support via _OSC 2019-04-23 16:38:16 -05:00
pci_slot.c
power.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
pptt.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
proc.c
processor_core.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
processor_driver.c
processor_idle.c ACPI / processor: Set P_LVL{2,3} idle state descriptions 2019-02-18 11:29:13 +01:00
processor_pdc.c
processor_perflib.c cpufreq: intel_pstate: Driver-specific handling of _PPC updates 2019-04-01 23:43:05 +02:00
processor_thermal.c
processor_throttling.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
property.c ACPI / property: fix handling of data_nodes in acpi_get_next_subnode() 2019-05-01 10:06:08 +02:00
reboot.c ACPI: Allow CONFIG_PCI to be unset for reboot 2018-12-20 10:19:49 +01:00
resource.c ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting 2019-02-24 21:12:01 +01:00
sbs.c ACPI / SBS: Fix GPE storm on recent MacBookPro's 2018-10-08 08:41:35 +02:00
sbshc.c ACPI / SBS: Fix rare oops when removing modules 2018-10-08 08:41:35 +02:00
sbshc.h
scan.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
sleep.c ACPI / sleep: Switch to use acpi_dev_get_first_match_dev() 2019-06-13 22:43:21 +02:00
sleep.h
spcr.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
sysfs.c ACPICA: Rename nameseg length macro/define for clarity 2019-04-09 11:24:48 +02:00
tables.c Driver core/kobject patches for 5.2-rc1 2019-05-07 13:01:40 -07:00
thermal.c
utils.c ACPI / utils: Remove deprecated function since no user left 2019-04-01 11:00:16 +02:00
video_detect.c Merge branches 'acpi-utils', 'acpi-video', 'acpi-soc' and 'acpi-button' 2019-05-06 10:50:08 +02:00
wakeup.c