[PATCH v2 1/2] dmr/amdgpu: Fix wrongly unref of BO

Christian König deathsimple at vodafone.de
Tue Apr 18 17:48:38 UTC 2017


Am 18.04.2017 um 17:43 schrieb Alex Xie:
> According to comment of amdgpu_bo_reserve, amdgpu_bo_reserve
> can return with -ERESTARTSYS. When this function was interrupted
> by a signal, BO should not be unref. Otherwise the BO might be
> released while is kmapped and pinned, or BO MIGHT be deref
> multiple times, etc.

NAK, as explained in the other thread freeing up a BO while it is mapped 
is perfectly ok.

On the other hand reserving the BO interruptible here doesn't make any 
sense at all, so should probably be fixed.

Regards,
Christian.

>
> Change-Id: If76071a768950a0d3ad9d5da7fcae04881807621
> Signed-off-by: Alex Xie <AlexBin.Xie at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index a09ad3cf..79b5fda 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -355,8 +355,8 @@ static void amdgpu_vram_scratch_fini(struct amdgpu_device *adev)
>   		amdgpu_bo_kunmap(adev->vram_scratch.robj);
>   		amdgpu_bo_unpin(adev->vram_scratch.robj);
>   		amdgpu_bo_unreserve(adev->vram_scratch.robj);
> +		amdgpu_bo_unref(&adev->vram_scratch.robj);
>   	}
> -	amdgpu_bo_unref(&adev->vram_scratch.robj);
>   }
>   
>   /**




More information about the amd-gfx mailing list