From ebe0533c50818b0f1d5683f87be2ecdc65bae40e Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Mon, 13 Dec 2010 15:27:06 -0800 Subject: [PATCH] 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 Signed-off-by: Benoit Goby [dima: fixed to work on 2.6.38, use .in_suspend instead of .state] Signed-off-by: Dima Zavin --- drivers/base/power/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index c154edd..8474d81 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -513,7 +513,7 @@ 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.in_suspend) dpm_wait(dev->parent, async); device_lock(dev); -- 2.7.4