summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-15 19:04:26 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-19 19:37:22 +0200
commita9a8f827f9e81dc8506d3283d166cd6efe822302 (patch)
tree9fb0e6edc08365926847e5e81a1e80f8588ba75f
parenta2d7b2e004af6b09f21ac3d10f8f4456c16a8ddf (diff)
downloadlinux-stable-a9a8f827f9e81dc8506d3283d166cd6efe822302.tar.gz
linux-stable-a9a8f827f9e81dc8506d3283d166cd6efe822302.tar.bz2
linux-stable-a9a8f827f9e81dc8506d3283d166cd6efe822302.zip
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 <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/power.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index ba6aaf7224a1..112256154880 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -731,8 +731,10 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state)
* put into arbitrary power state afterward.
*/
err = acpi_device_sleep_wake(dev, 1, sleep_state, 3);
- if (err)
+ if (err) {
+ acpi_power_off_list(&dev->wakeup.resources);
dev->wakeup.prepare_count = 0;
+ }
out:
mutex_unlock(&acpi_device_lock);