mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvpgu: free hw_sema before as binding
Free the hw_sema before releasing a channel's address space binding when freeing a channel. Since the semaphore pool can be freed after releasing the address space, we need to do this earlier on. Bug 1795076 Change-Id: Ic8ae7510af7be862feb6694130c6ce8fc0b8e411 Signed-off-by: Sachit Kadle <skadle@nvidia.com> Reviewed-on: http://git-master/r/1208071 (cherry picked from commit 82a52fb6789b1c9361c1567f082ca36135287294) Reviewed-on: http://git-master/r/1209165 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
246dcb824b
commit
510cf2d2f3
@@ -951,6 +951,14 @@ static void gk20a_free_channel(struct channel_gk20a *ch)
|
||||
}
|
||||
mutex_unlock(&ch->sync_lock);
|
||||
|
||||
/*
|
||||
* free the channel used semaphore index.
|
||||
* we need to do this before releasing the address space,
|
||||
* as the semaphore pool might get freed after that point.
|
||||
*/
|
||||
if (ch->hw_sema)
|
||||
gk20a_semaphore_free_hw_sema(ch);
|
||||
|
||||
/* release channel binding to the as_share */
|
||||
if (ch_vm->as_share)
|
||||
gk20a_as_release_share(ch_vm->as_share);
|
||||
@@ -974,10 +982,6 @@ unbind:
|
||||
g->ops.fifo.unbind_channel(ch);
|
||||
g->ops.fifo.free_inst(g, ch);
|
||||
|
||||
/* free the channel used semaphore index */
|
||||
if (ch->hw_sema)
|
||||
gk20a_semaphore_free_hw_sema(ch);
|
||||
|
||||
ch->vpr = false;
|
||||
ch->vm = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user