<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">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Rex Zhu <Rex.Zhu@amd.com><br>
<b>Sent:</b> Friday, August 24, 2018 5:32:22 AM<br>
<b>To:</b> Zhou, Hang; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH] drm/amdgpu: Enable/disable gfx PG feature in rlc safe mode</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">This is required by gfx hw and can fix the rlc hang when<br>
do s3 stree test on Cz/St.<br>
<br>
Signed-off-by: Hang Zhou <hang.zhou@amd.com><br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 11 ++++++++++-<br>
 1 file changed, 10 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
index 903725ba..a2acd76 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
@@ -5618,6 +5618,11 @@ static int gfx_v8_0_set_powergating_state(void *handle,<br>
         if (amdgpu_sriov_vf(adev))<br>
                 return 0;<br>
 <br>
+       if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_SMG |<br>
+                               AMD_PG_SUPPORT_RLC_SMU_HS |<br>
+                               AMD_PG_SUPPORT_CP |<br>
+                               AMD_PG_SUPPORT_GFX_DMG))<br>
+               adev->gfx.rlc.funcs->enter_safe_mode(adev);<br>
         switch (adev->asic_type) {<br>
         case CHIP_CARRIZO:<br>
         case CHIP_STONEY:<br>
@@ -5667,7 +5672,11 @@ static int gfx_v8_0_set_powergating_state(void *handle,<br>
         default:<br>
                 break;<br>
         }<br>
-<br>
+       if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_SMG |<br>
+                               AMD_PG_SUPPORT_RLC_SMU_HS |<br>
+                               AMD_PG_SUPPORT_CP |<br>
+                               AMD_PG_SUPPORT_GFX_DMG))<br>
+               adev->gfx.rlc.funcs->exit_safe_mode(adev);<br>
         return 0;<br>
 }<br>
 <br>
-- <br>
1.9.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>