summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 69fe4901..976e9171 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2830,10 +2830,13 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c,
2830 } else { 2830 } else {
2831 if (!tsg->tsg_gr_ctx) { 2831 if (!tsg->tsg_gr_ctx) {
2832 tsg->vm = c->vm; 2832 tsg->vm = c->vm;
2833 gk20a_vm_get(tsg->vm);
2833 err = gr_gk20a_alloc_tsg_gr_ctx(g, tsg); 2834 err = gr_gk20a_alloc_tsg_gr_ctx(g, tsg);
2834 if (err) { 2835 if (err) {
2835 gk20a_err(dev_from_gk20a(g), 2836 gk20a_err(dev_from_gk20a(g),
2836 "fail to allocate TSG gr ctx buffer"); 2837 "fail to allocate TSG gr ctx buffer");
2838 gk20a_vm_put(tsg->vm);
2839 tsg->vm = NULL;
2837 goto out; 2840 goto out;
2838 } 2841 }
2839 } 2842 }
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index e7b70894..849c3f6a 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -161,8 +161,10 @@ static void gk20a_tsg_release(struct kref *ref)
161 gr_gk20a_free_tsg_gr_ctx(tsg); 161 gr_gk20a_free_tsg_gr_ctx(tsg);
162 tsg->tsg_gr_ctx = NULL; 162 tsg->tsg_gr_ctx = NULL;
163 } 163 }
164 if (tsg->vm) 164 if (tsg->vm) {
165 gk20a_vm_put(tsg->vm);
165 tsg->vm = NULL; 166 tsg->vm = NULL;
167 }
166 168
167 release_used_tsg(&g->fifo, tsg); 169 release_used_tsg(&g->fifo, tsg);
168 170