<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<p style="font-family:Calibri;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div dir="auto"><span style="font-family:-apple-system, HelveticaNeue;font-size:14.6667px;display:inline !important">Looks ok to me.</span><span style="display: inline !important;">  </span><span style="font-family: -apple-system, HelveticaNeue; font-size: 14.6667px;">This
 Series is,</span></div>
<div dir="auto"><br style="font-family:-apple-system, HelveticaNeue;font-size:14.6667px">
<span style="font-family:-apple-system, HelveticaNeue;font-size:14.6667px;display:inline !important">Reviewed-by: Tim Huang <</span><a href="mailto:tim.huang@amd.com" class="ms-outlook-linkify" style="font-family: -apple-system, HelveticaNeue; font-size: 14.6667px; color: rgb(0, 120, 212);">tim.huang@amd.com</a><span style="font-family:-apple-system, HelveticaNeue;font-size:14.6667px;display:inline !important">></span><br>
</div>
<div id="ms-outlook-mobile-signature" dir="auto">
<div><br>
</div>
<div dir="auto"><br>
</div>
</div>
<div id="mail-editor-reference-message-container" dir="auto"><br>
<hr style="display:inline-block;width:98%">
<div id="divRplyFwdMsg" style="font-size: 11pt;"><strong>From:</strong> Jesse.zhang@amd.com <jesse.zhang@amd.com><br>
<strong>Sent:</strong> Monday, December 16, 2024 5:29:56 PM<br>
<strong>To:</strong> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<strong>Cc:</strong> Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Huang, Tim <Tim.Huang@amd.com>; Zhu, Jiadong <Jiadong.Zhu@amd.com>; Zhang, Jesse(Jie) <Jesse.Zhang@amd.com>; Huang, Tim <Tim.Huang@amd.com><br>
<strong>Subject:</strong> [PATCH 3/3] drm/amdgpu/pm: Implement SDMA queue reset for different asic<br>
</div>
<br>
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Implement sdma queue reset by SMU_MSG_ResetSDMA2<br>
<br>
Suggested-by: Tim Huang <tim.huang@amd.com><br>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com><br>
---<br>
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c  | 30 ++++++++++++++-----<br>
 1 file changed, 22 insertions(+), 8 deletions(-)<br>
<br>
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<br>
index 9222e7a777a6..446959145058 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c<br>
@@ -2721,17 +2721,31 @@ static int smu_v13_0_6_send_rma_reason(struct smu_context *smu)<br>
 <br>
 static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask)<br>
 {<br>
-       struct amdgpu_device *adev = smu->adev;<br>
+       uint32_t smu_program;<br>
         int ret = 0;<br>
 <br>
-       /* the message is only valid on SMU 13.0.6 with pmfw 85.121.00 and above */<br>
-       if ((adev->flags & AMD_IS_APU) ||<br>
-           amdgpu_ip_version(adev, MP1_HWIP, 0) != IP_VERSION(13, 0, 6) ||<br>
-           smu->smc_fw_version < 0x00557900)<br>
-               return 0;<br>
+       smu_program = (smu->smc_fw_version >> 24) & 0xff;<br>
+       switch (amdgpu_ip_version(smu->adev, MP1_HWIP, 0)) {<br>
+       case IP_VERSION(13, 0, 6):<br>
+               if (((smu_program == 7) && (smu->smc_fw_version > 0x07550763)) ||<br>
+                       ((smu_program == 0) && (smu->smc_fw_version > 0x00557700)))<br>
+                       ret = smu_cmn_send_smc_msg_with_param(smu,<br>
+                               SMU_MSG_ResetSDMA, inst_mask, NULL);<br>
+               else if ((smu_program == 4) &&<br>
+                       (smu->smc_fw_version > 0x4556e6c))<br>
+                       ret = smu_cmn_send_smc_msg_with_param(smu,<br>
+                                     SMU_MSG_ResetSDMA2, inst_mask, NULL);<br>
+               break;<br>
+       case IP_VERSION(13, 0, 14):<br>
+               if ((smu_program == 5) &&<br>
+                       (smu->smc_fw_version > 0x05550f00))<br>
+                       ret = smu_cmn_send_smc_msg_with_param(smu,<br>
+                                     SMU_MSG_ResetSDMA2, inst_mask, NULL);<br>
+               break;<br>
+       default:<br>
+               break;<br>
+       }<br>
 <br>
-       ret = smu_cmn_send_smc_msg_with_param(smu,<br>
-                                             SMU_MSG_ResetSDMA, inst_mask, NULL);<br>
         if (ret)<br>
                 dev_err(smu->adev->dev,<br>
                         "failed to send ResetSDMA event with mask 0x%x\n",<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font><br>
</div>
</div>
</body>
</html>