<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Huang Rui <ray.huang@amd.com><br>
<b>Sent:</b> Wednesday, January 20, 2021 8:13 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Quan, Evan <Evan.Quan@amd.com>; Huang, Ray <Ray.Huang@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/pm: print the timeout of smc message</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">This patch is to help firmware designer to know the smc message timeout<br>
status.<br>
<br>
Signed-off-by: Huang Rui <ray.huang@amd.com><br>
---<br>
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 11 ++++++++---<br>
 1 file changed, 8 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c<br>
index e4eff6d9f092..ffd373e63f0d 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c<br>
@@ -142,10 +142,15 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,<br>
 <br>
         ret = smu_cmn_wait_for_response(smu);<br>
         if (ret != 0x1) {<br>
-               dev_err(adev->dev, "failed send message: %10s (%d) \tparam: 0x%08x response %#x\n",<br>
-                       smu_get_message_name(smu, msg), index, param, ret);<br>
-               if (ret != -ETIME)<br>
+               if (ret == -ETIME) {<br>
+                       dev_err(adev->dev, "message: %10s (%d) \tparam: 0x%08x is timeout (no response)\n",<br>
+                               smu_get_message_name(smu, msg), index, param);<br>
+               } else {<br>
+                       dev_err(adev->dev, "failed send message: %10s (%d) \tparam: 0x%08x response %#x\n",<br>
+                               smu_get_message_name(smu, msg), index, param,<br>
+                               ret);<br>
                         ret = -EIO;</div>
<div class="PlainText">[kevin]:</div>
<div class="PlainText">the print format %10s is right aligned by default, change to %-10s is better to show it in kernel log.</div>
<div class="PlainText">and change 10 to 15 is better to adapt for all SMU msg names..</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Reviewed-by: Kevin Wang <kevin1.wang@amd.com></div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Best Regards,</div>
<div class="PlainText">Kevin</div>
<div class="PlainText">
<div><br>
</div>
</div>
<div class="PlainText">+               }<br>
                 goto out;<br>
         }<br>
 <br>
-- <br>
2.25.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CKevin1.Wang%40amd.com%7C0d1fa26019a94de6aefe08d8bd3cd3c1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637467416247588610%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=lUw0Kl44HCu83kjeTqCsSNP62KztSTGO80w6Yl6RaXc%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CKevin1.Wang%40amd.com%7C0d1fa26019a94de6aefe08d8bd3cd3c1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637467416247588610%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=lUw0Kl44HCu83kjeTqCsSNP62KztSTGO80w6Yl6RaXc%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>