From: Rafael J. Wysocki Date: Sun, 3 Feb 2013 13:57:32 +0000 (+0100) Subject: ACPI / PM: Handle missing _PSC in acpi_bus_update_power() X-Git-Tag: firefly_0821_release~3680^2~1034^2^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=511d5c4212948fe55035b8fed61ac0e125af5a05;p=firefly-linux-kernel-4.4.55.git ACPI / PM: Handle missing _PSC in acpi_bus_update_power() 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 --- diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 164d609d7c9e..dd314ef9bff1 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -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;