PM / QoS: Fix deadlock during PM QoS vote to default value

pm_qos_work_fn() calls pm_qos_update_request() which does
cancel_delayed_work_sync() on the same pm_qos_work_fn()
causing deadlock. Fix this by updating the target with
default timeout value directly instead of calling
pm_qos_update_request().

CRs-Fixed: 526216
Change-Id: I7de2fb1c89f87b0ebf7427116b8920aec50d5b2b
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
This commit is contained in:
Sujit Reddy Thumma 2013-08-13 09:31:32 +05:30 committed by Gerrit - the friendly Code Review server
parent f7e3692100
commit 2ef1e8d232
1 changed files with 8 additions and 1 deletions

View File

@ -237,11 +237,18 @@ EXPORT_SYMBOL_GPL(pm_qos_request_active);
*/
static void pm_qos_work_fn(struct work_struct *work)
{
s32 new_value = PM_QOS_DEFAULT_VALUE;
struct pm_qos_request *req = container_of(to_delayed_work(work),
struct pm_qos_request,
work);
pm_qos_update_request(req, PM_QOS_DEFAULT_VALUE);
if (!req || !pm_qos_request_active(req))
return;
if (new_value != req->node.prio)
pm_qos_update_target(
pm_qos_array[req->pm_qos_class]->constraints,
&req->node, PM_QOS_UPDATE_REQ, new_value);
}
/**