Skip to contentSkip to conversation

drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3

PATCH In review Yuan Feng 2 participants 2 messages Nov 19, 2024 – Nov 21, 2024

Subsystems (2)
lore
Share & tools
lore

Yuan Feng

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3

On SRIOV, guest driver and host driver might deploy different versions of MEC firmware binaries that lead to potential compability issues cause system hang. To solve this, host and guest deploy MEC fw with two level jump table.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +6 -1
index 03654bfda58a..6011332cce92 100644
@@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
 MODULE_FIRMWARE("amdgpu/gc_9_4_4_mec.bin");
 MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
 MODULE_FIRMWARE("amdgpu/gc_9_4_4_rlc.bin");
+MODULE_FIRMWARE("amdgpu/gc_9_4_3_sjt_mec.bin");
 
 #define GFX9_MEC_HPD_SIZE 4096
 #define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
@@ -574,7 +575,11 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct amdgpu_device *adev,
 {
 	int err;
 
-	err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+	if (amdgpu_sriov_vf(adev))
+		err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+				   "amdgpu/%s_sjt_mec.bin", chip_name);
+	else
+		err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
 				   "amdgpu/%s_mec.bin", chip_name);
 	if (err)
 		goto out;
Signature · 1 line
2.39.1.windows.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Yuan Feng

On SRIOV, guest driver and host driver might deploy different versions of MEC firmware binaries that lead to potential compability issues cause system hang. To solve this, host and guest deploy MEC fw with two level jump table.

Thanks,
Lijo

Quoted 29 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +6 -1
index 03654bfda58a..6011332cce92 100644
@@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
 MODULE_FIRMWARE("amdgpu/gc_9_4_4_mec.bin");
 MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
 MODULE_FIRMWARE("amdgpu/gc_9_4_4_rlc.bin");
+MODULE_FIRMWARE("amdgpu/gc_9_4_3_sjt_mec.bin");
 
 #define GFX9_MEC_HPD_SIZE 4096
 #define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
@@ -574,7 +575,11 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct amdgpu_device *adev,
 {
 	int err;
 
-	err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+	if (amdgpu_sriov_vf(adev))
+		err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+				   "amdgpu/%s_sjt_mec.bin", chip_name);
+	else
+		err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
 				   "amdgpu/%s_mec.bin", chip_name);
 	if (err)
 		goto out;