[PATCH 1/4] drm/amdgpu: fix object unreserved issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please check amdgpu_do_bo_create() logic, 

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of zhoucm1
Sent: 2018å¹´3æ??5æ?¥ 12:52
To: Liu, Monk <Monk.Liu at amd.com>; amd-gfx at lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/amdgpu: fix object unreserved issue



On 2018å¹´03æ??05æ?¥ 12:09, Monk Liu wrote:
> bo_do_create will unreserve in in the end if @resv is NULL, which 
> cause the following bo_create_shadow run without lock held on @resv
>
> Change-Id: Iaad24b8aea60522f25188874ab9d5c5f13f1a941
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 216799cc..d8a818d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -507,9 +507,12 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
>   		return r;
>   
>   	if ((flags & AMDGPU_GEM_CREATE_SHADOW) && amdgpu_need_backup(adev)) {
> -		if (!resv)
> -			WARN_ON(reservation_object_lock((*bo_ptr)->tbo.resv,
> -							NULL));
> +		if (!resv) {
> +			WARN_ON(reservation_object_lock((*bo_ptr)->tbo.resv, NULL));
isn't this locking resv?

> +			r = amdgpu_bo_reserve(*bo_ptr, kernel?true:false);
I don't think this is need.

Regards,
David Zhou
> +			if (unlikely(r))
> +				return r;
> +		}
>   
>   		r = amdgpu_bo_create_shadow(adev, size, byte_align, (*bo_ptr));
>   

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux