RE: [PATCH] drm/amd/pm: Refactor SMU 13.0.6 SDMA reset firmware version checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Official Use Only - AMD Internal Distribution Only]

You'd better re-coding this patch base on following patch from Lijo.

[PATCH] drm/amd/pm: Add capability flags for SMU v13.0.6

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Jesse.zhang@xxxxxxx
Sent: Friday, January 17, 2025 12:21
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Koenig, Christian <Christian.Koenig@xxxxxxx>; Huang, Tim <Tim.Huang@xxxxxxx>; Zhu, Jiadong <Jiadong.Zhu@xxxxxxx>; Lazar, Lijo <Lijo.Lazar@xxxxxxx>; Zhang, Jesse(Jie) <Jesse.Zhang@xxxxxxx>; Zhang, Jesse(Jie) <Jesse.Zhang@xxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>
Subject: [PATCH] drm/amd/pm: Refactor SMU 13.0.6 SDMA reset firmware version checks

From: "Jesse.zhang@xxxxxxx" <Jesse.zhang@xxxxxxx>

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
V3: except IP_VERSION(13, 0, 12) which is not supported.

Suggested-by: Lazar Lijo <Lijo.Lazar@xxxxxxx>
Signed-off-by: Jesse Zhang <jesse.zhang@xxxxxxx>
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>
---
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c  | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index 35e2f0662fb5..31d9aafe0e83 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -2746,12 +2746,23 @@ static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask)  {
        struct amdgpu_device *adev = smu->adev;
        int ret = 0;
-
-       /* the message is only valid on SMU 13.0.6 with pmfw 85.121.00 and above */
-       if ((adev->flags & AMD_IS_APU) ||
-           amdgpu_ip_version(adev, MP1_HWIP, 0) != IP_VERSION(13, 0, 6) ||
-           smu->smc_fw_version < 0x00557900)
-               return 0;
+       uint32_t smu_program;
+
+       smu_program = (smu->smc_fw_version >> 24) & 0xff;
+       /* the message is only valid on SMU 13.0.6/13.0.14 with these pmfw and above */
+       if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 12) ||
+               ((smu_program == 0) && (smu->smc_fw_version < 0x00557900)) ||
+               ((smu_program == 4) && (smu->smc_fw_version < 0x4557000)) ||
+               ((smu_program == 5) && (smu->smc_fw_version < 0x5551200)) ||
+               ((smu_program == 7) && (smu->smc_fw_version < 0x7550700))) {
+               dev_err(smu->adev->dev,
+               "ResetSDMA not supported: SMU program %u requires PMFW >= 0x%x\n"
+               "Current PMFW version: 0x%x\n", smu_program,
+               smu_program == 0 ? 0x00557900 : smu_program == 4 ? 0x4557000 :
+               smu_program == 5 ? 0x5551200 : smu_program == 7 ? 0x7550700 : 0,
+               smu->smc_fw_version);
+               return -EOPNOTSUPP;
+       }

        ret = smu_cmn_send_smc_msg_with_param(smu,
                                              SMU_MSG_ResetSDMA, inst_mask, NULL);
--
2.25.1





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux