diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 79d449e6..795c7910 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -951,6 +951,14 @@ static void gk20a_free_channel(struct channel_gk20a *ch) | |||
951 | } | 951 | } |
952 | mutex_unlock(&ch->sync_lock); | 952 | mutex_unlock(&ch->sync_lock); |
953 | 953 | ||
954 | /* | ||
955 | * free the channel used semaphore index. | ||
956 | * we need to do this before releasing the address space, | ||
957 | * as the semaphore pool might get freed after that point. | ||
958 | */ | ||
959 | if (ch->hw_sema) | ||
960 | gk20a_semaphore_free_hw_sema(ch); | ||
961 | |||
954 | /* release channel binding to the as_share */ | 962 | /* release channel binding to the as_share */ |
955 | if (ch_vm->as_share) | 963 | if (ch_vm->as_share) |
956 | gk20a_as_release_share(ch_vm->as_share); | 964 | gk20a_as_release_share(ch_vm->as_share); |
@@ -974,10 +982,6 @@ unbind: | |||
974 | g->ops.fifo.unbind_channel(ch); | 982 | g->ops.fifo.unbind_channel(ch); |
975 | g->ops.fifo.free_inst(g, ch); | 983 | g->ops.fifo.free_inst(g, ch); |
976 | 984 | ||
977 | /* free the channel used semaphore index */ | ||
978 | if (ch->hw_sema) | ||
979 | gk20a_semaphore_free_hw_sema(ch); | ||
980 | |||
981 | ch->vpr = false; | 985 | ch->vpr = false; |
982 | ch->vm = NULL; | 986 | ch->vm = NULL; |
983 | 987 | ||