<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Huang, Tim <Tim.Huang@amd.com><br>
<b>Sent:</b> Thursday, March 28, 2024 12:17 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Zhang, Yifan <Yifan1.Zhang@amd.com>; Huang, Tim <Tim.Huang@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/pm: fixes a random hang in S4 for SMU v13.0.4/11</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Tim Huang <Tim.Huang@amd.com><br>
<br>
While doing multiple S4 stress tests, GC/RLC/PMFW get into<br>
an invalid state resulting into hard hangs.<br>
<br>
Adding a GFX reset as workaround just before sending the<br>
MP1_UNLOAD message avoids this failure.<br>
<br>
Signed-off-by: Tim Huang <Tim.Huang@amd.com><br>
---<br>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c | 12 +++++++++++-<br>
1 file changed, 11 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c<br>
index e8119918ef6b..88f1a0d878f3 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c<br>
@@ -226,8 +226,18 @@ static int smu_v13_0_4_system_features_control(struct smu_context *smu, bool en)<br>
struct amdgpu_device *adev = smu->adev;<br>
int ret = 0;<br>
<br>
- if (!en && !adev->in_s0ix)<br>
+ if (!en && !adev->in_s0ix) {<br>
+ /* Adds a GFX reset as workaround just before sending the<br>
+ * MP1_UNLOAD message to prevent GC/RLC/PMFW from entering<br>
+ * an invalid state.<br>
+ */<br>
+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,<br>
+ SMU_RESET_MODE_2, NULL);<br>
+ if (ret)<br>
+ return ret;<br>
+<br>
ret = smu_cmn_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL);<br>
+ }<br>
<br>
return ret;<br>
}<br>
-- <br>
2.39.2<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>