summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/as_gk20a.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
index 1d604b83..42fa2167 100644
--- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
@@ -73,6 +73,7 @@ static int gk20a_as_alloc_share(struct gk20a_as *as,
73 */ 73 */
74int gk20a_as_release_share(struct gk20a_as_share *as_share) 74int gk20a_as_release_share(struct gk20a_as_share *as_share)
75{ 75{
76 struct gk20a *g = as_share->vm->mm->g;
76 int err; 77 int err;
77 78
78 gk20a_dbg_fn(""); 79 gk20a_dbg_fn("");
@@ -80,7 +81,10 @@ int gk20a_as_release_share(struct gk20a_as_share *as_share)
80 if (atomic_dec_return(&as_share->ref_cnt) > 0) 81 if (atomic_dec_return(&as_share->ref_cnt) > 0)
81 return 0; 82 return 0;
82 83
84 gk20a_busy(g->dev);
83 err = gk20a_vm_release_share(as_share); 85 err = gk20a_vm_release_share(as_share);
86 gk20a_idle(g->dev);
87
84 release_as_share_id(as_share->as, as_share->id); 88 release_as_share_id(as_share->as, as_share->id);
85 kfree(as_share); 89 kfree(as_share);
86 return err; 90 return err;
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index d2174f37..624eec94 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -2350,14 +2350,15 @@ int gk20a_vm_free_space(struct gk20a_as_share *as_share,
2350 mutex_lock(&vm->update_gmmu_lock); 2350 mutex_lock(&vm->update_gmmu_lock);
2351 va_node = addr_to_reservation(vm, args->offset); 2351 va_node = addr_to_reservation(vm, args->offset);
2352 if (va_node) { 2352 if (va_node) {
2353 struct mapped_buffer_node *buffer; 2353 struct mapped_buffer_node *buffer, *n;
2354 2354
2355 /* there is no need to unallocate the buffers in va. Just 2355 /* there is no need to unallocate the buffers in va. Just
2356 * convert them into normal buffers */ 2356 * convert them into normal buffers */
2357 2357
2358 list_for_each_entry(buffer, 2358 list_for_each_entry_safe(buffer, n,
2359 &va_node->va_buffers_list, va_buffers_list) 2359 &va_node->va_buffers_list, va_buffers_list) {
2360 list_del_init(&buffer->va_buffers_list); 2360 list_del_init(&buffer->va_buffers_list);
2361 }
2361 2362
2362 list_del(&va_node->reserved_va_list); 2363 list_del(&va_node->reserved_va_list);
2363 2364