<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 Emily Deng <Emily.Deng@amd.com><br>
<b>Sent:</b> Wednesday, March 7, 2018 9:55:02 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Deng, Emily<br>
<b>Subject:</b> [PATCH] drm/amdgpu: Correct the amdgpu_ucode_fini_bo place for Tonga</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">The amdgpu_ucode_fini_bo should be called after gfx_v8_0_hw_fini,<br>
or it will have KCQ disable failed issue.<br>
<br>
For Tonga, as it firstly finishes SMC block, and the SMC hw fini<br>
will call amdgpu_ucode_fini, which will lead the amdgpu_ucode_fini_bo<br>
called before gfx_v8_0_hw_fini, this is incorrect.<br>
<br>
Signed-off-by: Emily Deng <Emily.Deng@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 3 +++<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 3 ---<br>
 2 files changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index aa1e517..ac76983 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -1457,6 +1457,9 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)<br>
         }<br>
 <br>
         for (i = adev->num_ip_blocks - 1; i >= 0; i--) {<br>
+               if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC &&<br>
+                       adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)<br>
+                       amdgpu_ucode_fini_bo(adev);<br>
                 if (!adev->ip_blocks[i].status.hw)<br>
                         continue;<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c<br>
index 5c2e2d5..825c9b9 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c<br>
@@ -162,9 +162,6 @@ static int amdgpu_pp_hw_fini(void *handle)<br>
                 ret = adev->powerplay.ip_funcs->hw_fini(<br>
                                         adev->powerplay.pp_handle);<br>
 <br>
-       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)<br>
-               amdgpu_ucode_fini_bo(adev);<br>
-<br>
         return ret;<br>
 }<br>
 <br>
-- <br>
2.7.4<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>