From 664ce15717543b7909e8048e2cbc74be2a9ed6b9 Mon Sep 17 00:00:00 2001 From: Lauri Peltonen Date: Wed, 11 Jun 2014 14:04:37 +0300 Subject: 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 Reviewed-on: http://git-master/r/422159 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') 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) channel_gk20a_free_priv_cmdbuf(ch); + /* sync must be destroyed before releasing channel vm */ + if (ch->sync) { + ch->sync->destroy(ch->sync); + ch->sync = NULL; + } + /* release channel binding to the as_share */ gk20a_as_release_share(ch_vm->as_share); @@ -660,10 +666,6 @@ unbind: gk20a_channel_fence_close(&ch->last_submit.pre_fence); gk20a_channel_fence_close(&ch->last_submit.post_fence); - if (ch->sync) { - ch->sync->destroy(ch->sync); - ch->sync = NULL; - } WARN_ON(ch->sync); /* unlink all debug sessions */ -- cgit v1.2.2