[PATCH] drm/radeon: fix vm lock in radeon_gem_va_update_vm

Alex Deucher alexdeucher at gmail.com
Mon Oct 27 09:03:23 PDT 2014


On Thu, Oct 23, 2014 at 5:32 AM, Christian König
<deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at 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 at 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
>


More information about the dri-devel mailing list