summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorBenoit Goby <benoit@android.com>2010-12-13 15:27:06 -0800
committerBenoit Goby <benoit@android.com>2010-12-13 17:39:09 -0800
commit1cfb26afa1528c3c148f59aa0f6764d77c02659a (patch)
tree639a2357e8698edecf36cebfd332a643cc3475eb /drivers/base
parentb18f3941c749c36cb87df166fb593a27950046cb (diff)
PM: Wait for completion of the parent resume before resuming
If the parent device is in the DPM_RESUMING state, resume might get called before the parent's resume has completed, because dpm_wait won't get called. This issue was introduced by: 3d46a3c PM: Prevent waiting forever on asynchronous resume after abort Wait for completion of the parent resume if the parent state is >= DPM_OFF or == DPM_RESUMING Change-Id: I14a4e16426f61efceaefedc7e772f53b7522b5dd Signed-off-by: Benoit Goby <benoit@android.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 17aff79bd329..4a57ecc4ead9 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -528,7 +528,8 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
TRACE_DEVICE(dev);
TRACE_RESUME(0);
- if (dev->parent && dev->parent->power.status >= DPM_OFF)
+ if (dev->parent && (dev->parent->power.status >= DPM_OFF ||
+ dev->parent->power.status == DPM_RESUMING))
dpm_wait(dev->parent, async);
device_lock(dev);