mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: hold mutex to get cde context only
In gk20a_cde_convert(), we hold cde_app.mutex almost for everything which is unnecessary Also, this causes a deadlock scenario when gk20a_do_idle() is called In some cases it is possible that Thread 1 holds the lock and is trying to power on GPU, and Thread 2 is trying to power off GPU and then grab cde_app.mutex to cleanup GPU state To fix this, grab the mutex only for gk20a_cde_get_context() and then release it Bug 200287073 Change-Id: Ic4856604652d0d4024abdeb5c2f8f03910c601a5 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1324328 GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
009d9fd7f7
commit
3c8eef0d0e
@@ -948,8 +948,8 @@ __releases(&cde_app->mutex)
|
||||
return -EINVAL;
|
||||
|
||||
nvgpu_mutex_acquire(&g->cde_app.mutex);
|
||||
|
||||
cde_ctx = gk20a_cde_get_context(g);
|
||||
nvgpu_mutex_release(&g->cde_app.mutex);
|
||||
if (IS_ERR(cde_ctx)) {
|
||||
err = PTR_ERR(cde_ctx);
|
||||
goto exit_unlock;
|
||||
@@ -1119,7 +1119,6 @@ exit_unlock:
|
||||
if (surface)
|
||||
dma_buf_vunmap(compbits_scatter_buf, surface);
|
||||
|
||||
nvgpu_mutex_release(&g->cde_app.mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user