diff options
author | Sachit Kadle <skadle@nvidia.com> | 2016-08-25 20:15:32 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-09-20 13:43:36 -0400 |
commit | 510cf2d2f39a4776db4cd162c7e7525dbe17c3eb (patch) | |
tree | 01cbde1dfb69c9eff1949f1bbf5381e13c4a721a /drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |
parent | 246dcb824bc299b836be92fb74416c07a57e085b (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-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 | ||