summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-12-27 05:02:17 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-04 11:45:11 -0500
commite21e253f8372d8f2589a19f1df4e180ef6f57d1d (patch)
tree8f757f1f7044b32636a85f46f85fb844f6a3d034 /drivers/gpu/nvgpu/common/linux
parent965ff380cf364c443b399be4a9bd43b9e9737a97 (diff)
gpu: nvgpu: fix TSG leak from CDE code
In gk20a_cde_remove_ctx(), we unbind the channel from TSG and close the channel. But we do not drop the TSG refcount leaking the TSG reference After allocating sufficient contexts, we see TSG creation fails as below nvgpu: 17000000.gp10b: gk20a_cde_load:1286 [ERR] cde: could not create TSG Fix this by explicitly dropping TSG refcount Also, do not explicitly unbind the channel from TSG gk20a_channel_close() will internally unbind the channel from TSG Bug 200374011 Change-Id: If6d75b20d5e03d710c0597d7a320d1157206a2a5 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1627116 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r--drivers/gpu/nvgpu/common/linux/cde.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/cde.c b/drivers/gpu/nvgpu/common/linux/cde.c
index 02ee27bc..5f0dfb0b 100644
--- a/drivers/gpu/nvgpu/common/linux/cde.c
+++ b/drivers/gpu/nvgpu/common/linux/cde.c
@@ -106,12 +106,12 @@ __must_hold(&cde_app->mutex)
106 nvgpu_gmmu_unmap(vm, &g->gr.compbit_store.mem, 106 nvgpu_gmmu_unmap(vm, &g->gr.compbit_store.mem,
107 cde_ctx->backing_store_vaddr); 107 cde_ctx->backing_store_vaddr);
108 108
109 /* free the channel */ 109 /*
110 if (cde_ctx->tsg && ch) { 110 * free the channel
111 gk20a_tsg_unbind_channel(cde_ctx->ch); 111 * gk20a_channel_close() will also unbind the channel from TSG
112 } 112 */
113
114 gk20a_channel_close(ch); 113 gk20a_channel_close(ch);
114 nvgpu_ref_put(&cde_ctx->tsg->refcount, gk20a_tsg_release);
115 115
116 /* housekeeping on app */ 116 /* housekeeping on app */
117 nvgpu_list_del(&cde_ctx->list); 117 nvgpu_list_del(&cde_ctx->list);