mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 18:11:20 +00:00
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>
This commit is contained in:
parent
8f77578cc2
commit
25f3a5a285
1 changed files with 13 additions and 11 deletions
|
@ -252,19 +252,21 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
|
||||||
int pending_update = 0;
|
int pending_update = 0;
|
||||||
s32 temp;
|
s32 temp;
|
||||||
|
|
||||||
spin_lock_irqsave(&pm_qos_lock, flags);
|
if (pm_qos_req) { /*guard against callers passing in null */
|
||||||
if (new_value == PM_QOS_DEFAULT_VALUE)
|
spin_lock_irqsave(&pm_qos_lock, flags);
|
||||||
temp = pm_qos_array[pm_qos_req->pm_qos_class]->default_value;
|
if (new_value == PM_QOS_DEFAULT_VALUE)
|
||||||
else
|
temp = pm_qos_array[pm_qos_req->pm_qos_class]->default_value;
|
||||||
temp = new_value;
|
else
|
||||||
|
temp = new_value;
|
||||||
|
|
||||||
if (temp != pm_qos_req->value) {
|
if (temp != pm_qos_req->value) {
|
||||||
pending_update = 1;
|
pending_update = 1;
|
||||||
pm_qos_req->value = temp;
|
pm_qos_req->value = temp;
|
||||||
|
}
|
||||||
|
spin_unlock_irqrestore(&pm_qos_lock, flags);
|
||||||
|
if (pending_update)
|
||||||
|
update_target(pm_qos_req->pm_qos_class);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&pm_qos_lock, flags);
|
|
||||||
if (pending_update)
|
|
||||||
update_target(pm_qos_req->pm_qos_class);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(pm_qos_update_request);
|
EXPORT_SYMBOL_GPL(pm_qos_update_request);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue