Make genpd to take the WAKEUP_POWERED driver flag into account during system suspend/resume. More precisely, in case the WAKEUP_POWERED flag is set, let's leave the device in full power state and prevent the PM domain from being powered off. Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx> --- drivers/base/power/domain.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 24e39ce..dc18f88 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1037,8 +1037,11 @@ static int genpd_finish_suspend(struct device *dev, bool poweroff) if (IS_ERR(genpd)) return -EINVAL; - if (dev->power.wakeup_path && genpd_is_active_wakeup(genpd)) - return 0; + if (dev->power.wakeup_path) { + if (dev_pm_test_driver_flags(dev, DPM_FLAG_WAKEUP_POWERED) || + genpd_is_active_wakeup(genpd)) + return 0; + } if (poweroff) ret = pm_generic_poweroff_noirq(dev); @@ -1092,8 +1095,11 @@ static int genpd_resume_noirq(struct device *dev) if (IS_ERR(genpd)) return -EINVAL; - if (dev->power.wakeup_path && genpd_is_active_wakeup(genpd)) - return 0; + if (dev->power.wakeup_path) { + if (dev_pm_test_driver_flags(dev, DPM_FLAG_WAKEUP_POWERED) || + genpd_is_active_wakeup(genpd)) + return 0; + } genpd_lock(genpd); genpd_sync_power_on(genpd, true, 0); -- 2.7.4