diff options
author | Mark Gross <markgross@thegnar.org> | 2010-05-16 18:21:03 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-05-16 18:21:03 -0400 |
commit | 25f3a5a2854dce8b8413fd24cc9d5b9e3632be54 (patch) | |
tree | b118bb59ed435c22c888bf35f68a65ba1dd6e16e /kernel/pm_qos_params.c | |
parent | 8f77578cc2debaeb30a4ef6206f4ba10944bdcd8 (diff) |
PM: PM QOS update fix
This update handles a use case where pm_qos update requests need to
silently fail if the update is being sent to a handle that is NULL.
The problem was that the original pm_qos silently fails when a request
update is passed to a parameter that has not been added to the list yet.
This update restores that behavior.
Signed-off-by: markgross <markgross@thegnar.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/pm_qos_params.c')
-rw-r--r-- | kernel/pm_qos_params.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index a1aea040eb5..f42d3f737a3 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c | |||
@@ -252,19 +252,21 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, | |||
252 | int pending_update = 0; | 252 | int pending_update = 0; |
253 | s32 temp; | 253 | s32 temp; |
254 | 254 | ||
255 | spin_lock_irqsave(&pm_qos_lock, flags); | 255 | if (pm_qos_req) { /*guard against callers passing in null */ |
256 | if (new_value == PM_QOS_DEFAULT_VALUE) | 256 | spin_lock_irqsave(&pm_qos_lock, flags); |
257 | temp = pm_qos_array[pm_qos_req->pm_qos_class]->default_value; | 257 | if (new_value == PM_QOS_DEFAULT_VALUE) |
258 | else | 258 | temp = pm_qos_array[pm_qos_req->pm_qos_class]->default_value; |
259 | temp = new_value; | 259 | else |
260 | 260 | temp = new_value; | |
261 | if (temp != pm_qos_req->value) { | 261 | |
262 | pending_update = 1; | 262 | if (temp != pm_qos_req->value) { |
263 | pm_qos_req->value = temp; | 263 | pending_update = 1; |
264 | pm_qos_req->value = temp; | ||
265 | } | ||
266 | spin_unlock_irqrestore(&pm_qos_lock, flags); | ||
267 | if (pending_update) | ||
268 | update_target(pm_qos_req->pm_qos_class); | ||
264 | } | 269 | } |
265 | spin_unlock_irqrestore(&pm_qos_lock, flags); | ||
266 | if (pending_update) | ||
267 | update_target(pm_qos_req->pm_qos_class); | ||
268 | } | 270 | } |
269 | EXPORT_SYMBOL_GPL(pm_qos_update_request); | 271 | EXPORT_SYMBOL_GPL(pm_qos_update_request); |
270 | 272 | ||