summaryrefslogtreecommitdiffstats
path: root/drivers/base/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-10-24 02:08:30 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-10-24 02:08:30 +0200
commit34b1f76275a2cb8c1ce8e00095d200552b235122 (patch)
tree4dbb207a615c79692ccc741103cdb8ab83372bde /drivers/base/power
parente39473d0b9448e770f49b0b15e514be884264438 (diff)
downloadop-kernel-dev-34b1f76275a2cb8c1ce8e00095d200552b235122.zip
op-kernel-dev-34b1f76275a2cb8c1ce8e00095d200552b235122.tar.gz
PM / Domains: Check device PM QoS flags in pm_genpd_poweroff()
Make the generic PM domains pm_genpd_poweroff() function take device PM QoS flags into account when deciding whether or not to remove power from the domain. After this change the routine will return -EBUSY without executing the domain's .power_off() callback if there is at least one PM QoS flags request for at least one device in the domain and at least of those request has at least one of the NO_POWER_OFF and REMOTE_WAKEUP flags set. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Jean Pihet <j-pihet@ti.com> Reviewed-by: mark gross <markgross@thegnar.org>
Diffstat (limited to 'drivers/base/power')
-rw-r--r--drivers/base/power/domain.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index c22b869..e2cf392 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -470,10 +470,19 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
return -EBUSY;
not_suspended = 0;
- list_for_each_entry(pdd, &genpd->dev_list, list_node)
+ list_for_each_entry(pdd, &genpd->dev_list, list_node) {
+ enum pm_qos_flags_status stat;
+
+ stat = dev_pm_qos_flags(pdd->dev,
+ PM_QOS_FLAG_NO_POWER_OFF
+ | PM_QOS_FLAG_REMOTE_WAKEUP);
+ if (stat > PM_QOS_FLAGS_NONE)
+ return -EBUSY;
+
if (pdd->dev->driver && (!pm_runtime_suspended(pdd->dev)
|| pdd->dev->power.irq_safe))
not_suspended++;
+ }
if (not_suspended > genpd->in_progress)
return -EBUSY;
OpenPOWER on IntegriCloud