diff mbox

[1/4] drm/radeon: fix lockup when BOs aren't part of the VM on release

Message ID 1430147077-5116-1-git-send-email-deathsimple@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König April 27, 2015, 3:04 p.m. UTC
From: Christian König <christian.koenig@amd.com>

If we unmap BOs before releasing them them the intervall tree locks
up because we try to remove an entry not inside the tree.

Signed-off-by: Christian König <christian.koenig@amd.com>
CC: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/radeon_vm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Christian König April 27, 2015, 3:06 p.m. UTC | #1
On 27.04.2015 17:04, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> If we unmap BOs before releasing them them the intervall tree locks
> up because we try to remove an entry not inside the tree.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> CC: stable@vger.kernel.org

Somehow forgot to mention that Michel is the original author of this 
patch, I just fixed two additional lines which caused list corruption.

Regards,
Christian.

> ---
>   drivers/gpu/drm/radeon/radeon_vm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
> index 2a5a4a9..16d8e95 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -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);
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index 2a5a4a9..16d8e95 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -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);