msm: kgsl: Avoid spin lock recursion in adreno_drawctxt_dump

A sync fence timeout may lead to call adreno_drawctxt_dump().
At the same time, cmdbatch timer expires and scheduled to run
on same CPU, which might result into calling adreno_drawctxt_dump()
for the same context. This result into deadlock for drawctx->lock.
Use spin_lock_bh to disable soft irq (timer) while we are dumping
the sync pt for fence timeout.

Change-Id: I25461358aaff4b5011002f57bfe6b3cadce72dac
CRs-Fixed: 876017
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
This commit is contained in:
Prakash Kamliya 2015-07-21 18:39:12 +05:30 committed by Gerrit - the friendly Code Review server
parent cb292b81ae
commit 77ef993331
1 changed files with 7 additions and 2 deletions

View File

@ -60,7 +60,12 @@ void adreno_drawctxt_dump(struct kgsl_device *device,
kgsl_readtimestamp(device, context, KGSL_TIMESTAMP_CONSUMED, &start);
kgsl_readtimestamp(device, context, KGSL_TIMESTAMP_RETIRED, &retire);
spin_lock(&drawctxt->lock);
/*
* We may have cmdbatch timer running, which also uses same
* lock, take a lock with software interrupt disabled (bh)
* to avoid spin lock recursion.
*/
spin_lock_bh(&drawctxt->lock);
dev_err(device->dev,
" context[%d]: queue=%d, submit=%d, start=%d, retire=%d\n",
context->id, queue, drawctxt->submitted_timestamp,
@ -114,7 +119,7 @@ stats:
dev_err(device->dev, " context[%d]: submit times: %s\n",
context->id, buf);
spin_unlock(&drawctxt->lock);
spin_unlock_bh(&drawctxt->lock);
}
/**