summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index 7d0f7e9c..54ac36db 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -202,7 +202,7 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm)
202 struct vm_reserved_va_node *va_node, *va_node_tmp; 202 struct vm_reserved_va_node *va_node, *va_node_tmp;
203 struct tegra_vgpu_cmd_msg msg; 203 struct tegra_vgpu_cmd_msg msg;
204 struct tegra_vgpu_as_share_params *p = &msg.params.as_share; 204 struct tegra_vgpu_as_share_params *p = &msg.params.as_share;
205 struct rb_node *node; 205 struct nvgpu_rbtree_node *node = NULL;
206 int err; 206 int err;
207 207
208 gk20a_dbg_fn(""); 208 gk20a_dbg_fn("");
@@ -211,12 +211,11 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm)
211 /* TBD: add a flag here for the unmap code to recognize teardown 211 /* TBD: add a flag here for the unmap code to recognize teardown
212 * and short-circuit any otherwise expensive operations. */ 212 * and short-circuit any otherwise expensive operations. */
213 213
214 node = rb_first(&vm->mapped_buffers); 214 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers);
215 while (node) { 215 while (node) {
216 mapped_buffer = 216 mapped_buffer = mapped_buffer_from_rbtree_node(node);
217 container_of(node, struct mapped_buffer_node, node);
218 gk20a_vm_unmap_locked(mapped_buffer, NULL); 217 gk20a_vm_unmap_locked(mapped_buffer, NULL);
219 node = rb_first(&vm->mapped_buffers); 218 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers);
220 } 219 }
221 220
222 /* destroy remaining reserved memory areas */ 221 /* destroy remaining reserved memory areas */
@@ -406,7 +405,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
406 if (err) 405 if (err)
407 goto clean_up_user_allocator; 406 goto clean_up_user_allocator;
408 407
409 vm->mapped_buffers = RB_ROOT; 408 vm->mapped_buffers = NULL;
410 409
411 nvgpu_mutex_init(&vm->update_gmmu_lock); 410 nvgpu_mutex_init(&vm->update_gmmu_lock);
412 kref_init(&vm->ref); 411 kref_init(&vm->ref);