Ping..

-----Original Message-----
From: Quan, Evan 
Sent: Sunday, April 26, 2020 11:19 AM
To: Dan Carpenter <dan.carpen...@oracle.com>
Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander 
<alexander.deuc...@amd.com>
Subject: RE: [PATCH] drm/amdgpu: address the static checker warnings



-----Original Message-----
From: Dan Carpenter <dan.carpen...@oracle.com>
Sent: Friday, April 24, 2020 7:02 PM
To: Quan, Evan <evan.q...@amd.com>
Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander 
<alexander.deuc...@amd.com>
Subject: Re: [PATCH] drm/amdgpu: address the static checker warnings

On Fri, Apr 24, 2020 at 06:41:15PM +0800, Evan Quan wrote:
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4199 
> amdgpu_device_gpu_recover()
> error: we previously assumed 'hive' could be null (see line 4196)
> 
> This is introduced by "drm/amdgpu: optimize the gpu reset for XGMI setup V2".
> 
> Change-Id: I9c22b57abc9f512114112f93fb035f1fecf26beb
> Signed-off-by: Evan Quan <evan.q...@amd.com>
> Reported-by: Dan Carpenter <dan.carpen...@oracle.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 71278942f9f0..898338dc9605 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -4274,7 +4274,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device 
> *adev,
>               if (!amdgpu_device_lock_adev(tmp_adev, !hive)) {
>                       DRM_INFO("Bailing on TDR for s_job:%llx, as another 
> already in progress",
>                                 job ? job->base.id : -1);
> -                     mutex_unlock(&hive->hive_lock);
> +                     if (hive)
> +                             mutex_unlock(&hive->hive_lock);

In the current code, we know for a fact that "hive" is NULL at this point. 
[Evan] No, that's true for SGPU setup only. For XGMI setup(multiple dgpus 
interconnected with bridges), the "hive" here is not NULL.
Presumably this will be changed in the future?  Otherwise why not just delete 
the mutex_unlock() because it is dead code.

regards,
dan carpenter

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

Reply via email to