tmp_suning_uos_patched/drivers/acpi
Mika Westerberg 71b65445f0 ACPI / PM: Use target_state to set the device power state
Commit 20dacb71ad ("ACPI / PM: Rework device power management to follow
ACPI 6") changed the device power management to use D3hot if the device
in question does not have _PR3 method even if D3cold was requested by the
caller.

However, if the device has _PR3 device->power.state is also set to D3hot
instead of D3Cold after power resources have been turned off because
device->power.state will be assigned from "state" instead of
"target_state".

Next time the device is transitioned to D0, acpi_power_transition() will
find that the current power state of the device is D3hot instead of D3cold
which causes it to power down all resources required for the current
(wrong) state D3hot.

Below is a simplified ASL example of a real touch panel device which
triggers the problem:

  Scope (TPL1)
  {
      Name (_PR0, Package (1) { \_SB.PCI0.I2C1.PXTC })
      Name (_PR3, Package (1) { \_SB.PCI0.I2C1.PXTC })
      ...
  }

In both D0 and D3hot the same power resource is required. However, when
acpi_power_transition() turns off power resources required for D3hot (as
the device is transitioned to D0) it powers down PXTC which then makes the
device to lose its power.

Fix this by assigning "target_state" to the device power state instead of
"state" that is always D3hot even for devices with valid _PR3.

Fixes: 20dacb71ad (ACPI / PM: Rework device power management to follow ACPI 6)
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-07-28 16:29:08 +02:00
..
acpica
apei
pmic
ac.c
acpi_apd.c
acpi_cmos_rtc.c
acpi_extlog.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpss.c ACPI / LPSS: Fix up acpi_lpss_create_device() 2015-07-07 00:31:47 +02:00
acpi_memhotplug.c
acpi_pad.c
acpi_platform.c
acpi_pnp.c
acpi_processor.c
acpi_video.c
battery.c
battery.h
bgrt.c
blacklist.c
bus.c
button.c
cm_sbs.c
container.c
custom_method.c
debugfs.c
device_pm.c ACPI / PM: Use target_state to set the device power state 2015-07-28 16:29:08 +02:00
dock.c
ec_sys.c
ec.c
event.c
fan.c
glue.c
gsi.c
hed.c
int340x_thermal.c
internal.h
ioapic.c
Kconfig
Makefile
nfit.c nfit: add support for NVDIMM "latch" flag 2015-07-10 14:43:50 -04:00
nfit.h nfit: add support for NVDIMM "latch" flag 2015-07-10 14:43:50 -04:00
numa.c
nvs.c
osl.c
pci_irq.c
pci_link.c
pci_root.c
pci_slot.c
power.c
proc.c
processor_core.c
processor_driver.c
processor_idle.c
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c
property.c
reboot.c
resource.c Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'acpi-resources' 2015-07-16 23:47:19 +02:00
sbs.c
sbshc.c
sbshc.h
scan.c ACPI / scan: Add support for ACPI _CLS device matching 2015-07-07 01:55:20 +02:00
sleep.c
sleep.h
sysfs.c
tables.c
thermal.c
utils.c
video_detect.c
wakeup.c