remarkable-linux/drivers/acpi
Rafael J. Wysocki 5c7dd710f6 ACPI / PCI / PM: Fix device PM regression related to D3hot/D3cold
Commit 1cc0c998fd ("ACPI: Fix D3hot v D3cold confusion") introduced a
bug in __acpi_bus_set_power() and changed the behavior of
acpi_pci_set_power_state() in such a way that it generally doesn't work
as expected if PCI_D3hot is passed to it as the second argument.

First off, if ACPI_STATE_D3 (equal to ACPI_STATE_D3_COLD) is passed to
__acpi_bus_set_power() and the explicit_set flag is set for the D3cold
state, the function will try to execute AML method called "_PS4", which
doesn't exist.

Fix this by adding a check to ensure that the name of the AML method
to execute for transitions to ACPI_STATE_D3_COLD is correct in
__acpi_bus_set_power().  Also make sure that the explicit_set flag
for ACPI_STATE_D3_COLD will be set if _PS3 is present and modify
acpi_power_transition() to avoid accessing power resources for
ACPI_STATE_D3_COLD, because they don't exist.

Second, if PCI_D3hot is passed to acpi_pci_set_power_state() as the
target state, the function will request a transition to
ACPI_STATE_D3_HOT instead of ACPI_STATE_D3.  However,
ACPI_STATE_D3_HOT is now only marked as supported if the _PR3 AML
method is defined for the given device, which is rare.  This causes
problems to happen on systems where devices were successfully put
into ACPI D3 by pci_set_power_state(PCI_D3hot) which doesn't work
now.  In particular, some unused graphics adapters are not turned
off as a result.

To fix this issue restore the old behavior of
acpi_pci_set_power_state(), which is to request a transition to
ACPI_STATE_D3 (equal to ACPI_STATE_D3_COLD) if either PCI_D3hot or
PCI_D3cold is passed to it as the argument.

This approach is not ideal, because generally power should not
be removed from devices if PCI_D3hot is the target power state,
but since this behavior is relied on, we have no choice but to
restore it at the moment and spend more time on designing a
better solution in the future.

References: https://bugzilla.kernel.org/show_bug.cgi?id=43228
Reported-by: rocko <rockorequin@hotmail.com>
Reported-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Reported-and-tested-by: Peter <lekensteyn@gmail.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-17 16:16:16 -07:00
..
acpica Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
apei Merge branch 'apei' into release 2012-03-30 16:14:02 -04:00
ac.c
acpi_ipmi.c
acpi_memhotplug.c
acpi_pad.c
battery.c
bgrt.c ACPI: Add support for exposing BGRT data 2012-03-30 04:09:24 -04:00
blacklist.c
bus.c ACPI / PCI / PM: Fix device PM regression related to D3hot/D3cold 2012-05-17 16:16:16 -07:00
button.c
cm_sbs.c
container.c
custom_method.c
debugfs.c
dock.c
ec.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-03-30 16:45:39 -07:00
ec_sys.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
event.c
fan.c
glue.c
hed.c
internal.h
Kconfig ACPI: Add support for exposing BGRT data 2012-03-30 04:09:24 -04:00
Makefile ACPI: Add support for exposing BGRT data 2012-03-30 04:09:24 -04:00
numa.c
nvs.c ACPI / PM: print physical addresses consistently with other parts of kernel 2012-03-30 02:46:57 -04:00
osl.c Revert "ACPI: Make ACPI interrupt threaded" 2012-04-18 10:16:27 -07:00
pci_bind.c
pci_irq.c
pci_link.c
pci_root.c
pci_slot.c
power.c ACPI / PCI / PM: Fix device PM regression related to D3hot/D3cold 2012-05-17 16:16:16 -07:00
proc.c
processor_core.c
processor_driver.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-03-30 16:45:39 -07:00
processor_idle.c Merge branches 'idle-fix' and 'misc' into release 2012-04-06 21:48:59 -04:00
processor_perflib.c
processor_thermal.c ACPI: Do cpufreq clamping for throttling per package v2 2012-03-22 02:16:14 -04:00
processor_throttling.c ACPI throttling: fix endian bug in acpi_read_throttling_status() 2012-03-30 16:06:12 -04:00
reboot.c Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
sbs.c
sbshc.c
sbshc.h
scan.c ACPI / PCI / PM: Fix device PM regression related to D3hot/D3cold 2012-05-17 16:16:16 -07:00
sleep.c ACPI: Convert wake_sleep_flags to a value instead of function 2012-04-23 13:29:07 -07:00
sleep.h
sysfs.c
tables.c
thermal.c ACPI: Evaluate thermal trip points before reading temperature 2012-03-30 02:38:31 -04:00
utils.c
video.c ACPI video: Don't start video device until its associated input device has been allocated 2012-03-30 15:47:52 -04:00
video_detect.c
wakeup.c