drm/radeon: fix vm lock in radeon_gem_va_update_vm
Subsystems (2)
PATCH 1/1 drm/radeon: fix vm lock in radeon_gem_va_update_vm
From: Christian König <[email protected]>
Without the lock we might corrupt the BO lists.
Might be squashed into "update the VM after setting BO address" for upstreaming.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/radeon/radeon_gem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_gem.c +5 -1
@@ -559,12 +559,16 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev, goto error_unreserve; } +mutex_lock (&bo_va->vm->mutex); r =radeon_vm_clear_freed (rdev, bo_va->vm);if (r) - goto error_unreserve; + goto error_unlock; r =radeon_vm_bo_update (rdev, bo_va, &bo_va->bo->tbo.mem); +error_unlock: +mutex_unlock (&bo_va->vm->mutex); + error_unreserve:ttm_eu_backoff_reservation (&ticket, &list);
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Christian König
From: Christian König <[email protected]>
Without the lock we might corrupt the BO lists.
Might be squashed into "update the VM after setting BO address" for upstreaming.
Squashed into that commit.
Thanks!
Alex
Quoted 29 lines
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/radeon/radeon_gem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_gem.c +5
-2@@ -559,12 +559,16 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev, goto error_unreserve; } +mutex_lock (&bo_va->vm->mutex); r =radeon_vm_clear_freed (rdev, bo_va->vm);if (r) - goto error_unreserve; + goto error_unlock; r =radeon_vm_bo_update (rdev, bo_va, &bo_va->bo->tbo.mem); +error_unlock: +mutex_unlock (&bo_va->vm->mutex); + error_unreserve:ttm_eu_backoff_reservation (&ticket, &list); --
Quoted 2 lines
1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel