PM: Wait for completion of the parent resume before resuming
authorBenoit Goby <benoit@android.com>
Mon, 13 Dec 2010 23:27:06 +0000 (15:27 -0800)
committerColin Cross <ccross@android.com>
Tue, 14 Jun 2011 16:09:39 +0000 (09:09 -0700)
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 <benoit@android.com>
[dima: fixed to work on 2.6.38, use .in_suspend instead of .state]
Signed-off-by: Dima Zavin <dima@android.com>
drivers/base/power/main.c

index 111a77dba092e47bb53bfa97798becb01fe5bece..abd3e56b2fa6607d2787c4b96a8907baf32f771f 100644 (file)
@@ -512,7 +512,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);