Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Christian König <christian.koenig@amd.com>
Test-by: hadack@gmx.de
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
eb99070b d57c0edf

+16 -18
+16 -18
drivers/gpu/drm/radeon/radeon_vm.c
··· 493 493 } 494 494 495 495 if (bo_va->it.start || bo_va->it.last) { 496 - spin_lock(&vm->status_lock); 497 - if (list_empty(&bo_va->vm_status)) { 498 - /* add a clone of the bo_va to clear the old address */ 499 - struct radeon_bo_va *tmp; 500 - spin_unlock(&vm->status_lock); 501 - tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL); 502 - if (!tmp) { 503 - mutex_unlock(&vm->mutex); 504 - r = -ENOMEM; 505 - goto error_unreserve; 506 - } 507 - tmp->it.start = bo_va->it.start; 508 - tmp->it.last = bo_va->it.last; 509 - tmp->vm = vm; 510 - tmp->bo = radeon_bo_ref(bo_va->bo); 511 - spin_lock(&vm->status_lock); 512 - list_add(&tmp->vm_status, &vm->freed); 496 + /* add a clone of the bo_va to clear the old address */ 497 + struct radeon_bo_va *tmp; 498 + tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL); 499 + if (!tmp) { 500 + mutex_unlock(&vm->mutex); 501 + r = -ENOMEM; 502 + goto error_unreserve; 513 503 } 514 - spin_unlock(&vm->status_lock); 504 + tmp->it.start = bo_va->it.start; 505 + tmp->it.last = bo_va->it.last; 506 + tmp->vm = vm; 507 + tmp->bo = radeon_bo_ref(bo_va->bo); 515 508 516 509 interval_tree_remove(&bo_va->it, &vm->va); 517 510 bo_va->it.start = 0; 518 511 bo_va->it.last = 0; 512 + 513 + spin_lock(&vm->status_lock); 514 + list_del_init(&bo_va->vm_status); 515 + list_add(&tmp->vm_status, &vm->freed); 516 + spin_unlock(&vm->status_lock); 519 517 } 520 518 521 519 if (soffset || eoffset) {