[PATCH] drm/amdgpu: Remove unreachable code in amdgpu_xgmi_set_pstate()
Christian König
christian.koenig at amd.com
Wed Dec 20 14:12:58 UTC 2023
Am 20.12.23 um 14:56 schrieb Srinivasan Shanmugam:
> Fixes the below:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:706 amdgpu_xgmi_set_pstate() warn: ignoring unreachable code.
>
> Cc: Jonathan Kim <Jonathan.Kim at amd.com>
> Cc: Felix Kuehling <Felix.Kuehling at amd.com>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> index a6c88f2fe6e5..4b756f280c38 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> @@ -703,9 +703,6 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
> /* fw bug so temporarily disable pstate switching */
> return 0;
>
> - if (!hive || adev->asic_type != CHIP_VEGA20)
> - return 0;
> -
Well this isn't really fixing this. The problem is the "return 0;" above.
When this isn't working because of a fw bug then we should probably
completely remove the code to avoid warning like this.
Regards,
Christian.
> mutex_lock(&hive->hive_lock);
>
> if (is_hi_req)
More information about the amd-gfx
mailing list