Skip to content

Commit a9a8f82

Browse files
committed
ACPI: PM: Turn off wakeup power resources on _DSW/_PSW errors
If acpi_device_sleep_wake() called by acpi_enable_wakeup_device_power() returns an error which means that the evaluation of either _DWS or _PSW has failed, turn off all of the device's wakeup power resources to be consistent with the clearing of dev->wakeup.prepare_count. Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a2d7b2e commit a9a8f82

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/acpi/power.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,10 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state)
731731
* put into arbitrary power state afterward.
732732
*/
733733
err = acpi_device_sleep_wake(dev, 1, sleep_state, 3);
734-
if (err)
734+
if (err) {
735+
acpi_power_off_list(&dev->wakeup.resources);
735736
dev->wakeup.prepare_count = 0;
737+
}
736738

737739
out:
738740
mutex_unlock(&acpi_device_lock);

0 commit comments

Comments
 (0)