<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">Series is:</p>
<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 Quan, Evan <Evan.Quan@amd.com><br>
<b>Sent:</b> Tuesday, March 13, 2018 3:30:26 AM<br>
<b>To:</b> Zhu, Rex; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> RE: [PATCH 2/2] drm/amdgpu: Fix suspend hang on RV</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Reviewed-by: Evan Quan <evan.quan@amd.com><br>
<br>
-----Original Message-----<br>
From: amd-gfx [<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">mailto:amd-gfx-bounces@lists.freedesktop.org</a>] On Behalf Of Rex Zhu<br>
Sent: Tuesday, March 13, 2018 3:01 PM<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: Zhu, Rex <Rex.Zhu@amd.com><br>
Subject: [PATCH 2/2] drm/amdgpu: Fix suspend hang on RV<br>
<br>
1. ip_block's index should not compared to type.<br>
2. Add null function point check<br>
<br>
Change-Id: Idbef9e5c69beef631e1e18cbc6f8c40cfe44862c<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-<br>
 1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index 62d2740..a5d6f6b 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -1572,7 +1572,8 @@ int amdgpu_device_ip_suspend(struct amdgpu_device *adev)<br>
                 if (!adev->ip_blocks[i].status.valid)<br>
                         continue;<br>
                 /* ungate blocks so that suspend can properly shut them down */<br>
-               if (i != AMD_IP_BLOCK_TYPE_SMC) {<br>
+               if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_SMC<br>
+                       && adev->ip_blocks[i].version->funcs->set_clockgating_state) {<br>
                         r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,<br>
                                                                                      AMD_CG_STATE_UNGATE);<br>
                         if (r) {<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>
_______________________________________________<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>