drm/amdgpu: Free ucode bo memory during load failure v1
Subsystems (2)
PATCH 2/2 drm/amdgpu: Free ucode bo memory during load failure v1
Remove firmware.load_type check in amdgpu_ucode_free_bo.
If psp failed to load a firmware, it will set formware.load_type to AMDGPU_FW_LOAD_DIRECT for bring up purposes. This caused memory leak as amdpug_ucode_free_bo will skip freeing memory due to the load_type.
BUG:SWDEV-332449
Signed-off-by Alice Wong <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +3 -4
@@ -714,10 +714,9 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev)void amdgpu_ucode_free_bo (struct amdgpu_device *adev) { -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) -amdgpu_bo_free_kernel (&adev->firmware.fw_buf, - &adev->firmware.fw_buf_mc, - &adev->firmware.fw_buf_ptr); +amdgpu_bo_free_kernel (&adev->firmware.fw_buf, + &adev->firmware.fw_buf_mc, + &adev->firmware.fw_buf_ptr); }int amdgpu_ucode_init_bo (struct amdgpu_device *adev)
Signature · 1 line
2.25.1
PATCH 2/2 drm/amdgpu: Free ucode bo memory during load failure v1
[AMD Official Use Only]
Remove firmware.load_type check in amdgpu_ucode_free_bo.
If psp failed to load a firmware, it will set formware.load_type to AMDGPU_FW_LOAD_DIRECT for bring up purposes. This caused memory leak as amdpug_ucode_free_bo will skip freeing memory due to the load_type.
BUG:SWDEV-332449
Signed-off-by Alice Wong <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +3 -5
@@ -714,10 +714,9 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev)void amdgpu_ucode_free_bo (struct amdgpu_device *adev) { -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) -amdgpu_bo_free_kernel (&adev->firmware.fw_buf, - &adev->firmware.fw_buf_mc, - &adev->firmware.fw_buf_ptr); +amdgpu_bo_free_kernel (&adev->firmware.fw_buf, + &adev->firmware.fw_buf_mc, + &adev->firmware.fw_buf_ptr); }int amdgpu_ucode_init_bo (struct amdgpu_device *adev) --
2.25.1