Re: [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()'

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

 




On 1/23/2024 1:38 PM, Srinivasan Shanmugam wrote:
> 'adev->gfx.rlc_fw' may not be released before end of
> gfx_v10_0_init_microcode() function.
> 
> Using the function release_firmware() to release adev->gfx.rlc_fw.
> 
> Fixes the below:
> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:4046 gfx_v10_0_init_microcode() warn: 'adev->gfx.rlc_fw' from request_firmware() not released on lines: 4046.
> 

The release is done through this call -
amdgpu_ucode_release(&adev->gfx.rlc_fw);

Needs some other way to suppress the warning.

Thanks,
Lijo

> Fixes: 1797ec7ffd1b ("drm/amdgpu: skip rlc ucode loading for SRIOV gfx10")
> Cc: Monk Liu <Monk.Liu@xxxxxxx>
> Cc: Lijo Lazar <lijo.lazar@xxxxxxx>
> Cc: Hawking Zhang <Hawking.Zhang@xxxxxxx>
> Cc: Christian König <christian.koenig@xxxxxxx>
> Cc: Alex Deucher <alexander.deucher@xxxxxxx>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index 420c82b54650..ce76fbcc2602 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -4006,6 +4006,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
>  		rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
>  		version_major = le16_to_cpu(rlc_hdr->header.header_version_major);
>  		version_minor = le16_to_cpu(rlc_hdr->header.header_version_minor);
> +		release_firmware(adev->gfx.rlc_fw);
>  		err = amdgpu_gfx_rlc_init_microcode(adev, version_major, version_minor);
>  		if (err)
>  			goto out;



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

  Powered by Linux