drm/radeon: fix lockup when BOs aren't part of the VM on release
authorChristian König <christian.koenig@amd.com>
Mon, 27 Apr 2015 15:04:34 +0000 (17:04 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Apr 2015 15:27:59 +0000 (11:27 -0400)
If we unmap BOs before releasing them them the intervall tree locks
up because we try to remove an entry not inside the tree.

Based on a patch from Michel Dänzer.

Signed-off-by: Christian König <christian.koenig@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_vm.c

index 2a5a4a9e772d6668ee844b94c61219a0c3100340..16d8e95abd9413cb2529e25d6dc2d0d1b9726337 100644 (file)
@@ -1107,7 +1107,8 @@ void radeon_vm_bo_rmv(struct radeon_device *rdev,
        list_del(&bo_va->bo_list);
 
        mutex_lock(&vm->mutex);
-       interval_tree_remove(&bo_va->it, &vm->va);
+       if (bo_va->it.start || bo_va->it.last)
+               interval_tree_remove(&bo_va->it, &vm->va);
        spin_lock(&vm->status_lock);
        list_del(&bo_va->vm_status);