aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
diff options
context:
space:
mode:
authorMario Limonciello <[email protected]>2023-01-03 20:30:53 +0000
committerAlex Deucher <[email protected]>2023-01-09 22:02:18 +0000
commitc88135c089e4d126ad1b2d9494a32d3d9160df4e (patch)
tree9ef9c7bd27baffbd74f2ccfaaa4fb4d8da3508b6 /drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
parentdrm/amd: Load GFX10 microcode during early_init (diff)
downloadkernel-c88135c089e4d126ad1b2d9494a32d3d9160df4e.tar.gz
kernel-c88135c089e4d126ad1b2d9494a32d3d9160df4e.zip
drm/amd: Use `amdgpu_ucode_*` helpers for GFX11
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper will provide symmetery on unload. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/imu_v11_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/imu_v11_0.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c b/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
index 95548c512f4f..ed0d368149aa 100644
--- a/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
@@ -49,10 +49,7 @@ static int imu_v11_0_init_microcode(struct amdgpu_device *adev)
amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix, sizeof(ucode_prefix));
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_imu.bin", ucode_prefix);
- err = request_firmware(&adev->gfx.imu_fw, fw_name, adev->dev);
- if (err)
- goto out;
- err = amdgpu_ucode_validate(adev->gfx.imu_fw);
+ err = amdgpu_ucode_request(adev, &adev->gfx.imu_fw, fw_name);
if (err)
goto out;
imu_hdr = (const struct imu_firmware_header_v1_0 *)adev->gfx.imu_fw->data;
@@ -77,7 +74,7 @@ out:
dev_err(adev->dev,
"gfx11: Failed to load firmware \"%s\"\n",
fw_name);
- release_firmware(adev->gfx.imu_fw);
+ amdgpu_ucode_release(&adev->gfx.imu_fw);
}
return err;