diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 33086e9afaf65573cbb4efad0925954dc1301152..1aed94c73cfc63c161a2ba61b9e0be47dc69062f 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -450,6 +450,10 @@ static int pm_genpd_suspend_noirq(struct device *dev) if (ret) return ret; + if (device_may_wakeup(dev) + && genpd->active_wakeup && genpd->active_wakeup(dev)) + return 0; + if (genpd->stop_device) genpd->stop_device(dev); @@ -670,6 +674,10 @@ static int pm_genpd_dev_poweroff_noirq(struct device *dev) if (ret) return ret; + if (device_may_wakeup(dev) + && genpd->active_wakeup && genpd->active_wakeup(dev)) + return 0; + if (genpd->stop_device) genpd->stop_device(dev); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 7961b0dac4370e004a5462cd7abaefa1532fde0a..98491ee35102979c10ee3de9574aad37706538ab 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -38,6 +38,7 @@ struct generic_pm_domain { int (*power_on)(struct generic_pm_domain *domain); int (*start_device)(struct device *dev); int (*stop_device)(struct device *dev); + bool (*active_wakeup)(struct device *dev); }; static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)