The device can go direct to complete at __device_suspend and
device_resume if its driver has no callbacks. In that case,
pm_runtime_enable was called at device_resume without pm_runtime_disable
at __device_suspend when suspend was aborted at __devive_suspend
because of pending wakeups. It causes unbalanced pm_runtime_enable.
Change-Id: Iceec2a72efa7a15673663828e6e692ae6958ab28
Signed-off-by: Jeonghoon Jang <jnghn.jang@samsung.com>
if (dev->power.direct_complete) {
/* Match the pm_runtime_disable() in __device_suspend(). */
- pm_runtime_enable(dev);
+ if (!dev->power.is_suspend_aborted)
+ pm_runtime_enable(dev);
+ else
+ dev->power.is_suspend_aborted = false;
goto Complete;
}
MAX_SUSPEND_ABORT_LEN);
log_suspend_abort_reason(suspend_abort);
async_error = -EBUSY;
+ if (dev->power.direct_complete)
+ dev->power.is_suspend_aborted = true;
goto Complete;
}
bool wakeup_path:1;
bool syscore:1;
bool no_pm_callbacks:1; /* Owned by the PM core */
+ bool is_suspend_aborted:1; /* Owned by the PM core */
#else
unsigned int should_wakeup:1;
#endif