]> git.ipfire.org Git - people/arne_f/kernel.git/commit
ACPI / PM: Fix corner case in acpi_bus_update_power()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 4 Jul 2013 11:22:11 +0000 (13:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2013 00:16:07 +0000 (17:16 -0700)
commitacfd528b942f7dc9e7f52e6ba93c35e53dd98b52
tree92cfa4d0df9f2f322977083b51328b9c5085703c
parent7734cd8caba9f06fbb0bff0c80b60575b86007f9
ACPI / PM: Fix corner case in acpi_bus_update_power()

commit 91bdad0b6237c25a7bf8fd4604d0cc64a2005a23 upstream.

The role of acpi_bus_update_power() is to update the given ACPI
device object's power.state field to reflect the current physical
state of the device (as inferred from the configuration of power
resources and _PSC, if available).  For this purpose it calls
acpi_device_set_power() that should update the power resources'
reference counters and set power.state as appropriate.  However,
that doesn't work if the "new" state is D1, D2 or D3hot and the
the current value of power.state means D3cold, because in that
case acpi_device_set_power() will refuse to transition the device
from D3cold to non-D0.

To address this problem, make acpi_bus_update_power() call
acpi_power_transition() directly to update the power resources'
reference counters and only use acpi_device_set_power() to put
the device into D0 if the current physical state of it cannot
be determined.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/device_pm.c