* [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()'
@ 2024-01-23 8:08 Srinivasan Shanmugam
2024-01-23 8:21 ` Lazar, Lijo
2024-01-23 8:23 ` Liu, Monk
0 siblings, 2 replies; 3+ messages in thread
From: Srinivasan Shanmugam @ 2024-01-23 8:08 UTC (permalink / raw
To: Christian König, Alex Deucher
Cc: Lijo Lazar, Srinivasan Shanmugam, Monk Liu, amd-gfx,
Hawking Zhang
'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.
Fixes: 1797ec7ffd1b ("drm/amdgpu: skip rlc ucode loading for SRIOV gfx10")
Cc: Monk Liu <Monk.Liu@amd.com>
Cc: Lijo Lazar <lijo.lazar@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
---
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;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()'
2024-01-23 8:08 [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()' Srinivasan Shanmugam
@ 2024-01-23 8:21 ` Lazar, Lijo
2024-01-23 8:23 ` Liu, Monk
1 sibling, 0 replies; 3+ messages in thread
From: Lazar, Lijo @ 2024-01-23 8:21 UTC (permalink / raw
To: Srinivasan Shanmugam, Christian König, Alex Deucher
Cc: amd-gfx, Monk Liu, Hawking Zhang
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@amd.com>
> Cc: Lijo Lazar <lijo.lazar@amd.com>
> Cc: Hawking Zhang <Hawking.Zhang@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
> ---
> 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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()'
2024-01-23 8:08 [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()' Srinivasan Shanmugam
2024-01-23 8:21 ` Lazar, Lijo
@ 2024-01-23 8:23 ` Liu, Monk
1 sibling, 0 replies; 3+ messages in thread
From: Liu, Monk @ 2024-01-23 8:23 UTC (permalink / raw
To: SHANMUGAM, SRINIVASAN, Koenig, Christian, Deucher, Alexander,
Yin, ZhenGuo (Chris)
Cc: Lazar, Lijo, SHANMUGAM, SRINIVASAN, amd-gfx@lists.freedesktop.org,
Zhang, Hawking
[-- Attachment #1: Type: text/plain, Size: 2339 bytes --]
[AMD Official Use Only - General]
+ @Yin, ZhenGuo (Chris)<mailto:ZhenGuo.Yin@amd.com> for review
BR/
Monk Liu (Cloud and Virtualization Solution, SRDC)
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Date: Tuesday, January 23, 2024 at 16:09
To: Koenig, Christian <Christian.Koenig@amd.com>, Deucher, Alexander <Alexander.Deucher@amd.com>
Cc: Lazar, Lijo <Lijo.Lazar@amd.com>, SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@amd.com>, Liu, Monk <Monk.Liu@amd.com>, amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>, Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()'
'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.
Fixes: 1797ec7ffd1b ("drm/amdgpu: skip rlc ucode loading for SRIOV gfx10")
Cc: Monk Liu <Monk.Liu@amd.com>
Cc: Lijo Lazar <lijo.lazar@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
---
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;
--
2.34.1
[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 22720 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-23 8:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 8:08 [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()' Srinivasan Shanmugam
2024-01-23 8:21 ` Lazar, Lijo
2024-01-23 8:23 ` Liu, Monk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).