summaryrefslogtreecommitdiffstats
path: root/drivers/base/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-24 10:10:51 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-24 10:10:51 +0100
commit35546bd477146b75ae2a9ff2cb9bfcdb0f701015 (patch)
tree5e4b32a1dfbc029772a4e4a9df94981094235b6b /drivers/base/power
parent7e4d68443a80574392d1027ff34992ab945934a6 (diff)
downloadlinux-35546bd477146b75ae2a9ff2cb9bfcdb0f701015.tar.bz2
PM / QoS: Handle device PM QoS flags while removing constraints
PM QoS flags have to be handled by dev_pm_qos_constraints_destroy() in the same way as PM QoS resume latency constraints. That is, if they have been exposed to user space, they have to be hidden from it and the list of flags requests has to be flushed before destroying the device's PM QoS object. Make that happen. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power')
-rw-r--r--drivers/base/power/qos.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index fdc3894bc33a..f03f1ba28c75 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -223,12 +223,14 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
struct dev_pm_qos *qos;
struct dev_pm_qos_request *req, *tmp;
struct pm_qos_constraints *c;
+ struct pm_qos_flags *f;
/*
- * If the device's PM QoS resume latency limit has been exposed to user
- * space, it has to be hidden at this point.
+ * If the device's PM QoS resume latency limit or PM QoS flags have been
+ * exposed to user space, they have to be hidden at this point.
*/
dev_pm_qos_hide_latency_limit(dev);
+ dev_pm_qos_hide_flags(dev);
mutex_lock(&dev_pm_qos_mtx);
@@ -237,8 +239,8 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
if (!qos)
goto out;
+ /* Flush the constraints lists for the device. */
c = &qos->latency;
- /* Flush the constraints list for the device */
plist_for_each_entry_safe(req, tmp, &c->list, data.pnode) {
/*
* Update constraints list and call the notification
@@ -247,6 +249,11 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
memset(req, 0, sizeof(*req));
}
+ f = &qos->flags;
+ list_for_each_entry_safe(req, tmp, &f->list, data.flr.node) {
+ apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
+ memset(req, 0, sizeof(*req));
+ }
spin_lock_irq(&dev->power.lock);
dev->power.qos = NULL;