Skip to content

Commit

Permalink
ACPI / PM: Handle missing _PSC in acpi_bus_update_power()
Browse files Browse the repository at this point in the history
If _PS0 is defined for an ACPI device node, but _PSC isn't and
the device node doesn't use power resources for power management,
acpi_bus_update_power() will fail to update the power state of it,
because acpi_device_get_power() returns ACPI_STATE_UNKNOWN in that
case.

To handle that situation make acpi_bus_update_power() follow
acpi_bus_init_power() and try to force the given device node into
power state D0.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Rafael J. Wysocki committed Feb 3, 2013
1 parent b378549 commit 511d5c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/acpi/device_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ int acpi_bus_update_power(acpi_handle handle, int *state_p)
if (result)
return result;

if (state == ACPI_STATE_UNKNOWN)
state = ACPI_STATE_D0;

result = acpi_device_set_power(device, state);
if (!result && state_p)
*state_p = state;
Expand Down

0 comments on commit 511d5c4

Please sign in to comment.