Skip to contentSkip to conversation

drm/amdgpu/sdma4.4.2: add apu support in sdma queue reset

PATCH In review [email protected] 2 participants 5 messages Dec 13, 2024 – Dec 16, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/amdgpu/sdma4.4.2: add apu support in sdma queue reset

From: "[email protected]" <[email protected]>

Remove apu check in sdma queue reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +1 -1
index 5e1cb1c2c0f8..e39f1f495ea8 100644
@@ -1600,7 +1600,7 @@ static int sdma_v4_4_2_reset_queue(struct amdgpu_ring *ring, unsigned int vmid)
 	int i, r;
 	u32 inst_mask;
 
-	if ((adev->flags & AMD_IS_APU) || amdgpu_sriov_vf(adev))
+	if (amdgpu_sriov_vf(adev))
 		return -EINVAL;
 
 	/* stop queue */
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/3 drm/amd/pm: update 13_0_6 ppsmc header

From: "[email protected]" <[email protected]>

add the definition PPSMC_MSG_ResetSDMA2.

---
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h | 1 +
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h                 | 3 ++-
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c         | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h +1 -0
index 147bfb12fd75..7b65a27fb302 100644
@@ -93,6 +93,7 @@
 #define PPSMC_MSG_SelectPLPDMode                    0x40
 #define PPSMC_MSG_RmaDueToBadPageThreshold          0x43
 #define PPSMC_MSG_SelectPstatePolicy                0x44
+#define PPSMC_MSG_ResetSDMA2                        0x45
 #define PPSMC_MSG_ResetSDMA                         0x4D
 #define PPSMC_Message_Count                         0x4E
 
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +2 -1
index e4cd6a0d13da..b0dab9797c70 100644
@@ -276,7 +276,8 @@
 	__SMU_DUMMY_MAP(SelectPstatePolicy), \
 	__SMU_DUMMY_MAP(MALLPowerController), \
 	__SMU_DUMMY_MAP(MALLPowerState), \
-	__SMU_DUMMY_MAP(ResetSDMA),
+	__SMU_DUMMY_MAP(ResetSDMA), \
+	__SMU_DUMMY_MAP(ResetSDMA2),
 
 #undef __SMU_DUMMY_MAP
 #define __SMU_DUMMY_MAP(type)	SMU_MSG_##type
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -0
index 5b86df0c8536..9222e7a777a6 100644
@@ -194,6 +194,7 @@ static const struct cmn2asic_msg_mapping smu_v13_0_6_message_map[SMU_MSG_MAX_COU
 	MSG_MAP(RmaDueToBadPageThreshold,            PPSMC_MSG_RmaDueToBadPageThreshold,        0),
 	MSG_MAP(SelectPstatePolicy,                  PPSMC_MSG_SelectPstatePolicy,              0),
 	MSG_MAP(ResetSDMA,                           PPSMC_MSG_ResetSDMA,                       0),
+	MSG_MAP(ResetSDMA2,                          PPSMC_MSG_ResetSDMA2,                      0),
 };
 
 // clang-format on
Signature · 1 line
2.25.1
#2 lore raw

PATCH 3/3 drm/amdgpu/pm: Implement SDMA queue for different asic

In reply to [email protected]

From: "[email protected]" <[email protected]>

Implement sdma queue reset by SMU_MSG_ResetSDMA2.

---
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c  | 28 ++++++++++++++-----
 1 file changed, 21 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +21 -7
index 9222e7a777a6..e57d83099f4c 100644
@@ -2724,14 +2724,28 @@ 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;
+	switch (amdgpu_ip_version(smu->adev, MP1_HWIP, 0)) {
+	case IP_VERSION(13, 0, 6):
+		if (((smu->smc_fw_version > 0x07550763) &&
+		    (smu->smc_fw_version < 0x080000000)) ||
+		    ((smu->smc_fw_version > 0x00557700) &&
+		    (smu->smc_fw_version < 0x01000000)))
+			ret = smu_cmn_send_smc_msg_with_param(smu,
+				SMU_MSG_ResetSDMA, inst_mask, NULL);
+		else if ((adev->flags & AMD_IS_APU) &&
+			(smu->smc_fw_version > 0x4556e6c))
+			ret = smu_cmn_send_smc_msg_with_param(smu,
+				      SMU_MSG_ResetSDMA2, inst_mask, NULL);
+		break;
+	case IP_VERSION(13, 0, 14):
+		if (smu->smc_fw_version > 0x05550f00)
+			ret = smu_cmn_send_smc_msg_with_param(smu,
+				      SMU_MSG_ResetSDMA2, inst_mask, NULL);
+		break;
+	default:
+		break;
+	}
 
-	ret = smu_cmn_send_smc_msg_with_param(smu,
-					      SMU_MSG_ResetSDMA, inst_mask, NULL);
 	if (ret)
 		dev_err(smu->adev->dev,
 			"failed to send ResetSDMA event with mask 0x%x\n",
Signature · 1 line
2.25.1
#3 lore raw

RE: [PATCH 3/3] drm/amdgpu/pm: Implement SDMA queue for different asic

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jesse,

Quoted 10 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Friday, December 13, 2024 7:41 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhu, Jiadong <[email protected]>; Huang, Tim <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH 3/3] drm/amdgpu/pm: Implement SDMA queue for different asic

Here missed a "reset" for the subject?

Quoted 23 lines

From: "[email protected]" <[email protected]>

Implement sdma queue reset by SMU_MSG_ResetSDMA2.

---
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c  | 28
++++++++++++++-----
 1 file changed, 21 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +0 -1
index 9222e7a777a6..e57d83099f4c 100644
@@ -2724,14 +2724,28 @@ 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 */

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask) · line 2732

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +6 -4
-     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;
+     switch (amdgpu_ip_version(smu->adev, MP1_HWIP, 0)) {
+     case IP_VERSION(13, 0, 6):
+             if (((smu->smc_fw_version > 0x07550763) &&
+                 (smu->smc_fw_version < 0x080000000)) ||
+                 ((smu->smc_fw_version > 0x00557700) &&
+                 (smu->smc_fw_version < 0x01000000)))

Just curious why there're two ranges, Are they intended for two different ASICs?

Tim

Quoted 23 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +15 -3
+                     ret = smu_cmn_send_smc_msg_with_param(smu,
+                             SMU_MSG_ResetSDMA, inst_mask, NULL);
+             else if ((adev->flags & AMD_IS_APU) &&
+                     (smu->smc_fw_version > 0x4556e6c))
+                     ret = smu_cmn_send_smc_msg_with_param(smu,
+                                   SMU_MSG_ResetSDMA2, inst_mask, NULL);
+             break;
+     case IP_VERSION(13, 0, 14):
+             if (smu->smc_fw_version > 0x05550f00)
+                     ret = smu_cmn_send_smc_msg_with_param(smu,
+                                   SMU_MSG_ResetSDMA2, inst_mask, NULL);
+             break;
+     default:
+             break;
+     }
 
-     ret = smu_cmn_send_smc_msg_with_param(smu,
-                                           SMU_MSG_ResetSDMA, inst_mask, NULL);
      if (ret)
              dev_err(smu->adev->dev,
                      "failed to send ResetSDMA event with mask 0x%x\n",
--

2.25.1

#4 lore raw

RE: [PATCH 3/3] drm/amdgpu/pm: Implement SDMA queue for different asic

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Tim

-----Original Message-----
From: Huang, Tim <[email protected]>
Sent: Monday, December 16, 2024 4:29 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhu, Jiadong <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: RE: [PATCH 3/3] drm/amdgpu/pm: Implement SDMA queue for different asic

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jesse,

Quoted 10 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Friday, December 13, 2024 7:41 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhu, Jiadong <[email protected]>; Huang, Tim <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH 3/3] drm/amdgpu/pm: Implement SDMA queue for different asic

Here missed a "reset" for the subject?

Quoted 23 lines

From: "[email protected]" <[email protected]>

Implement sdma queue reset by SMU_MSG_ResetSDMA2.

---
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c  | 28
++++++++++++++-----
 1 file changed, 21 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +0 -1
index 9222e7a777a6..e57d83099f4c 100644
@@ -2724,14 +2724,28 @@ 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 */

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask) · line 2732

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +6 -4
-     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;
+     switch (amdgpu_ip_version(smu->adev, MP1_HWIP, 0)) {
+     case IP_VERSION(13, 0, 6):
+             if (((smu->smc_fw_version > 0x07550763) &&
+                 (smu->smc_fw_version < 0x080000000)) ||
+                 ((smu->smc_fw_version > 0x00557700) &&
+                 (smu->smc_fw_version < 0x01000000)))

Just curious why there're two ranges, Are they intended for two different ASICs?
Yes, I will update the patch according to our offline discussion.

Tim

Quoted 24 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +15 -2
+                     ret = smu_cmn_send_smc_msg_with_param(smu,
+                             SMU_MSG_ResetSDMA, inst_mask, NULL);
+             else if ((adev->flags & AMD_IS_APU) &&
+                     (smu->smc_fw_version > 0x4556e6c))
+                     ret = smu_cmn_send_smc_msg_with_param(smu,
+                                   SMU_MSG_ResetSDMA2, inst_mask, NULL);
+             break;
+     case IP_VERSION(13, 0, 14):
+             if (smu->smc_fw_version > 0x05550f00)
+                     ret = smu_cmn_send_smc_msg_with_param(smu,
+                                   SMU_MSG_ResetSDMA2, inst_mask, NULL);
+             break;
+     default:
+             break;
+     }
 
-     ret = smu_cmn_send_smc_msg_with_param(smu,
-                                           SMU_MSG_ResetSDMA, inst_mask, NULL);
      if (ret)
              dev_err(smu->adev->dev,
                      "failed to send ResetSDMA event with mask

0x%x\n",
--
2.25.1