]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: fix amdgpu_vm_fini
authorChristian König <christian.koenig@amd.com>
Thu, 18 Oct 2018 12:29:28 +0000 (14:29 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 25 Oct 2018 19:04:40 +0000 (14:04 -0500)
We should not remove mappings in rbtree_postorder_for_each_entry_safe
because that rebalances the tree.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 6904d794d60a7a5c06057f74cf930db06a01e195..db0cbf8d219d75931fb7e8a1a05bee9a8e6c9ba8 100644 (file)
@@ -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) {