Commit eb99070b authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/radeon: allways add the VM clear duplicate

We need to allways add the VM clear duplicate of the BO_VA,
no matter what the old status was.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Test-by: hadack@gmx.de
Tested-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d57c0edf
...@@ -493,29 +493,27 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, ...@@ -493,29 +493,27 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
} }
if (bo_va->it.start || bo_va->it.last) { if (bo_va->it.start || bo_va->it.last) {
spin_lock(&vm->status_lock); /* add a clone of the bo_va to clear the old address */
if (list_empty(&bo_va->vm_status)) { struct radeon_bo_va *tmp;
/* add a clone of the bo_va to clear the old address */ tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL);
struct radeon_bo_va *tmp; if (!tmp) {
spin_unlock(&vm->status_lock); mutex_unlock(&vm->mutex);
tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL); r = -ENOMEM;
if (!tmp) { goto error_unreserve;
mutex_unlock(&vm->mutex);
r = -ENOMEM;
goto error_unreserve;
}
tmp->it.start = bo_va->it.start;
tmp->it.last = bo_va->it.last;
tmp->vm = vm;
tmp->bo = radeon_bo_ref(bo_va->bo);
spin_lock(&vm->status_lock);
list_add(&tmp->vm_status, &vm->freed);
} }
spin_unlock(&vm->status_lock); tmp->it.start = bo_va->it.start;
tmp->it.last = bo_va->it.last;
tmp->vm = vm;
tmp->bo = radeon_bo_ref(bo_va->bo);
interval_tree_remove(&bo_va->it, &vm->va); interval_tree_remove(&bo_va->it, &vm->va);
bo_va->it.start = 0; bo_va->it.start = 0;
bo_va->it.last = 0; bo_va->it.last = 0;
spin_lock(&vm->status_lock);
list_del_init(&bo_va->vm_status);
list_add(&tmp->vm_status, &vm->freed);
spin_unlock(&vm->status_lock);
} }
if (soffset || eoffset) { if (soffset || eoffset) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment