Skip to contentSkip to conversation

drm/amdgpu: fix amdgpu_vm_fini

PATCH New Christian König 1 participant 1 message Oct 25, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 drm/amdgpu: fix amdgpu_vm_fini

We should not remove mappings in rbtree_postorder_for_each_entry_safe because that rebalances the tree.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3 -1
index 6904d794d60a..db0cbf8d219d 100644
@@ -3234,8 +3234,10 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 	}
 	rbtree_postorder_for_each_entry_safe(mapping, tmp,
 					     &vm->va.rb_root, rb) {
+		/* Don't remove the mapping here, we don't want to trigger a
+		 * rebalance and the tree is about to be destroyed anyway.
+		 */
 		list_del(&mapping->list);
-		amdgpu_vm_it_remove(mapping, &vm->va);
 		kfree(mapping);
 	}
 	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx