Skip to content

Commit

Permalink
msm: kgsl: Do not wait for FT gate in fault tolerance state
Browse files Browse the repository at this point in the history
When device start fails, device is in INIT state and FT is triggered.
In FT we trigger snapshot which waits on ft_gate when active count is
0 and device is not in active state. This causes a deadlock. This
change does not wait for FT gate in FT state and thereby prevents
the deadlock.

CRs-Fixed: 526206
Change-Id: Id9e0a7c3f3f9367d0b3cc17e45fbba4b42bebf64
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
  • Loading branch information
Tarun Karra authored and intervigilium committed Nov 5, 2013
1 parent ffbda1f commit 0ae896a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/gpu/msm/kgsl_pwrctrl.c
Expand Up @@ -1292,6 +1292,8 @@ int kgsl_pwrctrl_wake(struct kgsl_device *device)
case KGSL_STATE_ACTIVE:
kgsl_pwrctrl_request_state(device, KGSL_STATE_NONE);
break;
case KGSL_STATE_INIT:
break;
default:
KGSL_PWR_WARN(device, "unhandled state %s\n",
kgsl_pwrstate_to_str(device->state));
Expand Down Expand Up @@ -1384,10 +1386,13 @@ int kgsl_active_count_get(struct kgsl_device *device)
BUG_ON(!mutex_is_locked(&device->mutex));

if (device->active_cnt == 0) {
mutex_unlock(&device->mutex);
wait_for_completion(&device->hwaccess_gate);
wait_for_completion(&device->ft_gate);
mutex_lock(&device->mutex);

if (device->state != KGSL_STATE_DUMP_AND_FT) {
mutex_unlock(&device->mutex);
wait_for_completion(&device->hwaccess_gate);
wait_for_completion(&device->ft_gate);
mutex_lock(&device->mutex);
}

ret = kgsl_pwrctrl_wake(device);
}
Expand Down

0 comments on commit 0ae896a

Please sign in to comment.