diff options
author | Christian König <christian.koenig@amd.com> | 2018-10-18 08:29:28 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-10-25 15:04:40 -0400 |
commit | 0af5c656fdb797f74ee57414e0c07cd57406d0c3 (patch) | |
tree | 0ffabe681c3f80a1909954df74a41ede03fccfab /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 3732eb0683c17113201cd29fdefd7a58b1acfa7f (diff) |
drm/amdgpu: fix amdgpu_vm_fini
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 6904d794d60a..db0cbf8d219d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -3234,8 +3234,10 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) | |||
3234 | } | 3234 | } |
3235 | rbtree_postorder_for_each_entry_safe(mapping, tmp, | 3235 | rbtree_postorder_for_each_entry_safe(mapping, tmp, |
3236 | &vm->va.rb_root, rb) { | 3236 | &vm->va.rb_root, rb) { |
3237 | /* Don't remove the mapping here, we don't want to trigger a | ||
3238 | * rebalance and the tree is about to be destroyed anyway. | ||
3239 | */ | ||
3237 | list_del(&mapping->list); | 3240 | list_del(&mapping->list); |
3238 | amdgpu_vm_it_remove(mapping, &vm->va); | ||
3239 | kfree(mapping); | 3241 | kfree(mapping); |
3240 | } | 3242 | } |
3241 | list_for_each_entry_safe(mapping, tmp, &vm->freed, list) { | 3243 | list_for_each_entry_safe(mapping, tmp, &vm->freed, list) { |