mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: kgsl: Retry hard reset more than once on failure
It has been observed that if hard reset is tried again after failure then it succeeds, so add a loop to retry hard reset a few times before considering it a failure. Change-Id: I46dd8a420d5fd49941d096168aafd2eab693bebb Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
This commit is contained in:
parent
9091e989e2
commit
3e699d1a91
1 changed files with 23 additions and 7 deletions
|
@ -41,6 +41,9 @@
|
||||||
#define DRIVER_VERSION_MAJOR 3
|
#define DRIVER_VERSION_MAJOR 3
|
||||||
#define DRIVER_VERSION_MINOR 1
|
#define DRIVER_VERSION_MINOR 1
|
||||||
|
|
||||||
|
/* Number of times to try hard reset */
|
||||||
|
#define NUM_TIMES_RESET_RETRY 5
|
||||||
|
|
||||||
/* Adreno MH arbiter config*/
|
/* Adreno MH arbiter config*/
|
||||||
#define ADRENO_CFG_MHARB \
|
#define ADRENO_CFG_MHARB \
|
||||||
(0x10 \
|
(0x10 \
|
||||||
|
@ -1727,6 +1730,7 @@ int adreno_reset(struct kgsl_device *device)
|
||||||
{
|
{
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
struct kgsl_mmu *mmu = &device->mmu;
|
struct kgsl_mmu *mmu = &device->mmu;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
/* Try soft reset first, for non mmu fault case only */
|
/* Try soft reset first, for non mmu fault case only */
|
||||||
if (!atomic_read(&mmu->fault)) {
|
if (!atomic_read(&mmu->fault)) {
|
||||||
|
@ -1735,16 +1739,28 @@ int adreno_reset(struct kgsl_device *device)
|
||||||
KGSL_DEV_ERR_ONCE(device, "Device soft reset failed\n");
|
KGSL_DEV_ERR_ONCE(device, "Device soft reset failed\n");
|
||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
/* If soft reset failed or skipped, then pull the power */
|
for (i = 0; i < NUM_TIMES_RESET_RETRY; i++) {
|
||||||
ret = adreno_stop(device);
|
/* If soft reset failed/skipped, then pull the power */
|
||||||
if (ret)
|
ret = adreno_stop(device);
|
||||||
return ret;
|
if (ret) {
|
||||||
|
msleep(20);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ret = adreno_start(device);
|
ret = adreno_start(device);
|
||||||
|
|
||||||
if (ret)
|
if (ret) {
|
||||||
return ret;
|
msleep(20);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
if (0 != i)
|
||||||
|
KGSL_DRV_WARN(device, "Device hard reset tried %d tries\n", i);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If active_cnt is non-zero then the system was active before
|
* If active_cnt is non-zero then the system was active before
|
||||||
|
|
Loading…
Reference in a new issue