From: Christian König christian.koenig@amd.com
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 christian.koenig@amd.com --- drivers/gpu/drm/radeon/radeon_gem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 0002575..49d56b5 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -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);
On Thu, Oct 23, 2014 at 5:32 AM, Christian König deathsimple@vodafone.de wrote:
From: Christian König christian.koenig@amd.com
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
Signed-off-by: Christian König christian.koenig@amd.com
drivers/gpu/drm/radeon/radeon_gem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 0002575..49d56b5 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -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);
-- 1.9.1
dri-devel@lists.freedesktop.org