drm/amdgpu: fix amdgpu_vm_fini
Subsystems (2)
PATCH 1/1 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 | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -1
@@ -3235,7 +3235,6 @@ 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) {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
A message that is not in the archive (sent off-list or not yet received): 20181018123140.62411-1-christian.koenig-5C7GfCeVMHo@public.gmane.org
Quoted 13 lines · Christian König
We should not remove mappings in
rbtree_postorder_for_each_entry_safebecause that rebalances the tree.Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) · line 3238
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-1@@ -3235,7 +3235,6 @@ 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) {list_del (&mapping->list); -amdgpu_vm_it_remove (mapping, &vm->va);kfree (mapping);
At least, we should add some comments here, like rb_root would be invalid, we cannot use it any more, although that is fact. Or as you suggested to me before, we can change to while(next_node)...:)
anyway, depending on your favorite, Reviewed-by: Chunming Zhou <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) · line 3240
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0}list_for_each_entry_safe (mapping, tmp, &vm->freed, list) {
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx