Skip to content

Commit 875596b

Browse files
Jie1zhangalexdeucher
authored andcommitted
drm/amd/pm: Refactor SMU 13.0.6 SDMA reset firmware version checks
This patch refactors the firmware version checks in `smu_v13_0_6_reset_sdma` to support multiple SMU programs with different firmware version thresholds. V2: return -EOPNOTSUPP for unspported pmfw Suggested-by: Lazar Lijo <Lijo.Lazar@amd.com> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 2e76184 commit 875596b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2834,12 +2834,19 @@ static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask)
28342834
{
28352835
struct amdgpu_device *adev = smu->adev;
28362836
int ret = 0;
2837-
2838-
/* the message is only valid on SMU 13.0.6 with pmfw 85.121.00 and above */
2839-
if ((adev->flags & AMD_IS_APU) ||
2840-
amdgpu_ip_version(adev, MP1_HWIP, 0) != IP_VERSION(13, 0, 6) ||
2841-
smu->smc_fw_version < 0x00557900)
2842-
return 0;
2837+
uint32_t smu_program;
2838+
2839+
smu_program = (smu->smc_fw_version >> 24) & 0xff;
2840+
/* the message is only valid on SMU 13.0.6/12/14 with these pmfw and above */
2841+
if (((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 12)) &&
2842+
(smu->smc_fw_version < 0x00561700)) ||
2843+
((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 14)) &&
2844+
(smu->smc_fw_version < 0x5551200)) ||
2845+
((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 6)) &&
2846+
(((smu_program == 0) && (smu->smc_fw_version < 0x00557900)) ||
2847+
((smu_program == 4) && (smu->smc_fw_version < 0x4557000)) ||
2848+
((smu_program == 7) && (smu->smc_fw_version < 0x7550700)))))
2849+
return -EOPNOTSUPP;
28432850

28442851
ret = smu_cmn_send_smc_msg_with_param(smu,
28452852
SMU_MSG_ResetSDMA, inst_mask, NULL);

0 commit comments

Comments
 (0)