Commit 25f3a5a2 authored by Mark Gross's avatar Mark Gross Committed by Rafael J. Wysocki

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: default avatarmarkgross <markgross@thegnar.org>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 8f77578c
...@@ -252,6 +252,7 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, ...@@ -252,6 +252,7 @@ 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;
if (pm_qos_req) { /*guard against callers passing in null */
spin_lock_irqsave(&pm_qos_lock, flags); spin_lock_irqsave(&pm_qos_lock, flags);
if (new_value == PM_QOS_DEFAULT_VALUE) if (new_value == PM_QOS_DEFAULT_VALUE)
temp = pm_qos_array[pm_qos_req->pm_qos_class]->default_value; temp = pm_qos_array[pm_qos_req->pm_qos_class]->default_value;
...@@ -265,6 +266,7 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, ...@@ -265,6 +266,7 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
spin_unlock_irqrestore(&pm_qos_lock, flags); spin_unlock_irqrestore(&pm_qos_lock, flags);
if (pending_update) if (pending_update)
update_target(pm_qos_req->pm_qos_class); update_target(pm_qos_req->pm_qos_class);
}
} }
EXPORT_SYMBOL_GPL(pm_qos_update_request); EXPORT_SYMBOL_GPL(pm_qos_update_request);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment