Skip to content

Commit

Permalink
ACPI / PM: Fix device power state value after transitions to D3cold
Browse files Browse the repository at this point in the history
When a transition to the D3cold power state is requested,
acpi_device_set_power() first carries out a transition to D3hot and
then turns off the device's power resources.  However, it fails to
update the device's power.state field appropriately and D3hot is
stored in it as a result.

Fix this, but make sure that the device's power state will be
D3hot if its power resources cannot be turned off in the final
step.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Rafael J. Wysocki committed Jan 22, 2013
1 parent 898fee4 commit e565627
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/acpi/device_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,11 @@ int acpi_device_set_power(struct acpi_device *device, int state)
if (result)
goto end;

if (cut_power)
result = acpi_power_transition(device, ACPI_STATE_D3_COLD);
if (cut_power) {
device->power.state = state;
state = ACPI_STATE_D3_COLD;
result = acpi_power_transition(device, state);
}

end:
if (result) {
Expand Down

0 comments on commit e565627

Please sign in to comment.