summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorLauri Peltonen <lpeltonen@nvidia.com>2014-06-11 07:04:37 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:10 -0400
commit664ce15717543b7909e8048e2cbc74be2a9ed6b9 (patch)
tree469e2e27a891fb11127dd37557db31f0819419a1 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentdbde063bf6048551ab0b49a9a7de7e31e7bbad03 (diff)
gpu: nvgpu: Destroy channel sync before releasing vm
The semaphore backend of gk20a_channel_sync uses the channel vm. We must destroy the channel sync before freeing the channel vm. Bug 1450122 Change-Id: I578567b7500672534d53facc58643df49df8b305 Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> Reviewed-on: http://git-master/r/422159 GVS: Gerrit_Virtual_Submit Reviewed-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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index a9aec435..f5d5e467 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -648,6 +648,12 @@ void gk20a_free_channel(struct channel_gk20a *ch, bool finish)
648 648
649 channel_gk20a_free_priv_cmdbuf(ch); 649 channel_gk20a_free_priv_cmdbuf(ch);
650 650
651 /* sync must be destroyed before releasing channel vm */
652 if (ch->sync) {
653 ch->sync->destroy(ch->sync);
654 ch->sync = NULL;
655 }
656
651 /* release channel binding to the as_share */ 657 /* release channel binding to the as_share */
652 gk20a_as_release_share(ch_vm->as_share); 658 gk20a_as_release_share(ch_vm->as_share);
653 659
@@ -660,10 +666,6 @@ unbind:
660 666
661 gk20a_channel_fence_close(&ch->last_submit.pre_fence); 667 gk20a_channel_fence_close(&ch->last_submit.pre_fence);
662 gk20a_channel_fence_close(&ch->last_submit.post_fence); 668 gk20a_channel_fence_close(&ch->last_submit.post_fence);
663 if (ch->sync) {
664 ch->sync->destroy(ch->sync);
665 ch->sync = NULL;
666 }
667 WARN_ON(ch->sync); 669 WARN_ON(ch->sync);
668 670
669 /* unlink all debug sessions */ 671 /* unlink all debug sessions */