msm: kgsl: Ignore EAGAIN when programming perfcounter
When programming perfcounter via gpu commands, we may encounter -EAGAIN because of cancelling rb events either due to soft reset or when powering down the device. Ignore this error because we have already set up the perfcounter in software and it will be programmed in hardware by adreno_perfcounter_restore when gpu comes back up. CRs-Fixed: 1024199 Change-Id: I5dc3561d15fa50ac58646f96559cfd262020dda9 Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
This commit is contained in:
parent
e1f711f8e0
commit
8a7ca4ded7
2 changed files with 29 additions and 10 deletions
|
@ -2109,8 +2109,6 @@ static int adreno_soft_reset(struct kgsl_device *device)
|
||||||
adreno_support_64bit(adreno_dev))
|
adreno_support_64bit(adreno_dev))
|
||||||
gpudev->enable_64bit(adreno_dev);
|
gpudev->enable_64bit(adreno_dev);
|
||||||
|
|
||||||
/* Restore physical performance counter values after soft reset */
|
|
||||||
adreno_perfcounter_restore(adreno_dev);
|
|
||||||
|
|
||||||
/* Reinitialize the GPU */
|
/* Reinitialize the GPU */
|
||||||
gpudev->start(adreno_dev);
|
gpudev->start(adreno_dev);
|
||||||
|
@ -2137,6 +2135,9 @@ static int adreno_soft_reset(struct kgsl_device *device)
|
||||||
set_bit(ADRENO_DEVICE_STARTED, &adreno_dev->priv);
|
set_bit(ADRENO_DEVICE_STARTED, &adreno_dev->priv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Restore physical performance counter values after soft reset */
|
||||||
|
adreno_perfcounter_restore(adreno_dev);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -522,13 +522,19 @@ int adreno_perfcounter_get(struct adreno_device *adreno_dev,
|
||||||
if (empty == -1)
|
if (empty == -1)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
/* enable the new counter */
|
|
||||||
ret = adreno_perfcounter_enable(adreno_dev, groupid, empty, countable);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
/* initialize the new counter */
|
/* initialize the new counter */
|
||||||
group->regs[empty].countable = countable;
|
group->regs[empty].countable = countable;
|
||||||
|
|
||||||
|
/* enable the new counter */
|
||||||
|
ret = adreno_perfcounter_enable(adreno_dev, groupid, empty, countable);
|
||||||
|
if (ret) {
|
||||||
|
/* Put back the perfcounter */
|
||||||
|
if (!(group->flags & ADRENO_PERFCOUNTER_GROUP_FIXED))
|
||||||
|
group->regs[empty].countable =
|
||||||
|
KGSL_PERFCOUNTER_NOT_USED;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* set initial kernel and user count */
|
/* set initial kernel and user count */
|
||||||
if (flags & PERFCOUNTER_FLAG_KERNEL) {
|
if (flags & PERFCOUNTER_FLAG_KERNEL) {
|
||||||
group->regs[empty].kernelcount = 1;
|
group->regs[empty].kernelcount = 1;
|
||||||
|
@ -720,10 +726,22 @@ static int _perfcounter_enable_default(struct adreno_device *adreno_dev,
|
||||||
/* wait for the above commands submitted to complete */
|
/* wait for the above commands submitted to complete */
|
||||||
ret = adreno_ringbuffer_waittimestamp(rb, rb->timestamp,
|
ret = adreno_ringbuffer_waittimestamp(rb, rb->timestamp,
|
||||||
ADRENO_IDLE_TIMEOUT);
|
ADRENO_IDLE_TIMEOUT);
|
||||||
if (ret)
|
if (ret) {
|
||||||
KGSL_DRV_ERR(device,
|
/*
|
||||||
"Perfcounter %u/%u/%u start via commands failed %d\n",
|
* If we were woken up because of cancelling rb events
|
||||||
group, counter, countable, ret);
|
* either due to soft reset or adreno_stop, ignore the
|
||||||
|
* error and return 0 here. The perfcounter is already
|
||||||
|
* set up in software and it will be programmed in
|
||||||
|
* hardware when we wake up or come up after soft reset,
|
||||||
|
* by adreno_perfcounter_restore.
|
||||||
|
*/
|
||||||
|
if (ret == -EAGAIN)
|
||||||
|
ret = 0;
|
||||||
|
else
|
||||||
|
KGSL_DRV_ERR(device,
|
||||||
|
"Perfcounter %u/%u/%u start via commands failed %d\n",
|
||||||
|
group, counter, countable, ret);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Select the desired perfcounter */
|
/* Select the desired perfcounter */
|
||||||
kgsl_regwrite(device, reg->select, countable);
|
kgsl_regwrite(device, reg->select, countable);
|
||||||
|
|
Loading…
Add table
Reference in a new issue