diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-24 04:10:51 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-24 04:10:51 -0500 |
commit | 35546bd477146b75ae2a9ff2cb9bfcdb0f701015 (patch) | |
tree | 5e4b32a1dfbc029772a4e4a9df94981094235b6b /drivers/base/power | |
parent | 7e4d68443a80574392d1027ff34992ab945934a6 (diff) |
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.c | 13 |
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) | |||
223 | struct dev_pm_qos *qos; | 223 | struct dev_pm_qos *qos; |
224 | struct dev_pm_qos_request *req, *tmp; | 224 | struct dev_pm_qos_request *req, *tmp; |
225 | struct pm_qos_constraints *c; | 225 | struct pm_qos_constraints *c; |
226 | struct pm_qos_flags *f; | ||
226 | 227 | ||
227 | /* | 228 | /* |
228 | * If the device's PM QoS resume latency limit has been exposed to user | 229 | * If the device's PM QoS resume latency limit or PM QoS flags have been |
229 | * space, it has to be hidden at this point. | 230 | * exposed to user space, they have to be hidden at this point. |
230 | */ | 231 | */ |
231 | dev_pm_qos_hide_latency_limit(dev); | 232 | dev_pm_qos_hide_latency_limit(dev); |
233 | dev_pm_qos_hide_flags(dev); | ||
232 | 234 | ||
233 | mutex_lock(&dev_pm_qos_mtx); | 235 | mutex_lock(&dev_pm_qos_mtx); |
234 | 236 | ||
@@ -237,8 +239,8 @@ void dev_pm_qos_constraints_destroy(struct device *dev) | |||
237 | if (!qos) | 239 | if (!qos) |
238 | goto out; | 240 | goto out; |
239 | 241 | ||
242 | /* Flush the constraints lists for the device. */ | ||
240 | c = &qos->latency; | 243 | c = &qos->latency; |
241 | /* Flush the constraints list for the device */ | ||
242 | plist_for_each_entry_safe(req, tmp, &c->list, data.pnode) { | 244 | plist_for_each_entry_safe(req, tmp, &c->list, data.pnode) { |
243 | /* | 245 | /* |
244 | * Update constraints list and call the notification | 246 | * Update constraints list and call the notification |
@@ -247,6 +249,11 @@ void dev_pm_qos_constraints_destroy(struct device *dev) | |||
247 | apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); | 249 | apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); |
248 | memset(req, 0, sizeof(*req)); | 250 | memset(req, 0, sizeof(*req)); |
249 | } | 251 | } |
252 | f = &qos->flags; | ||
253 | list_for_each_entry_safe(req, tmp, &f->list, data.flr.node) { | ||
254 | apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); | ||
255 | memset(req, 0, sizeof(*req)); | ||
256 | } | ||
250 | 257 | ||
251 | spin_lock_irq(&dev->power.lock); | 258 | spin_lock_irq(&dev->power.lock); |
252 | dev->power.qos = NULL; | 259 | dev->power.qos = NULL; |