Skip to content
Browse files

PM / Sleep: Prevent waiting forever on asynchronous suspend after abort

commit 1f758b2 upstream.

__device_suspend() must always send a completion. Otherwise, parent
devices will wait forever.

Commit 1e2ef05, "PM: Limit race conditions between runtime PM and
system sleep (v2)", introduced a regression by short-circuiting the
complete_all() for certain error cases.

This patch fixes the bug by always signalling a completion.


Tested by injecting an abort.

Signed-off-by: Mandeep Singh Baines <>
Signed-off-by: Rafael J. Wysocki <>
Signed-off-by: Ben Hutchings <>
  • Loading branch information...
1 parent 69d1e4c commit 2a095a707c3ce005151ef2d31786508286c6d549 Mandeep Singh Baines committed with bwhacks Jun 24, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 drivers/base/power/main.c
6 drivers/base/power/main.c
@@ -869,7 +869,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
dpm_wait_for_children(dev, async);
if (async_error)
- return 0;
+ goto Complete;
if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
@@ -878,7 +878,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
if (pm_wakeup_pending()) {
async_error = -EBUSY;
- return 0;
+ goto Complete;
@@ -926,6 +926,8 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
+ Complete:
if (error) {

0 comments on commit 2a095a7

Please sign in to comment.
Something went wrong with that request. Please try again.