<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<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 dir="ltr">
<div></div>
<div>
<div dir="ltr">
<div dir="ltr">Reviewed-by: Yang Wang <kevinyang.wang@amd.com></div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Best Regards,</div>
<div dir="ltr">Kevin</div>
<div dir="ltr"><span id="ms-outlook-ios-cursor"></span></div>
</div>
<div id="mail-editor-reference-message-container" class="ms-outlook-mobile-reference-message">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif"><b>发件人:</b> Kamal, Asad <Asad.Kamal@amd.com><br>
<b>发送时间:</b> 星期五, 八月 18, 2023 19:01<br>
<b>收件人:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Wang, Yang(Kevin) <KevinYang.Wang@amd.com><br>
<b>抄送:</b> Lazar, Lijo <Lijo.Lazar@amd.com>; Zhang, Morris <Shiwu.Zhang@amd.com>; Kamal, Asad <Asad.Kamal@amd.com>; Ma, Le <Le.Ma@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>主题:</b> [PATCH v2] drm/amd/pm: Fix critical temp unit of SMU v13.0.6
<div> </div>
</font></div>
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Critical Temperature needs to be reported in<br>
millidegree Celsius.<br>
<br>
Signed-off-by: Asad Kamal <asad.kamal@amd.com><br>
---<br>
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 9 +++++----<br>
 1 file changed, 5 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c<br>
index 7d8af9b309b7..d3b578e6bc2a 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c<br>
@@ -2086,7 +2086,7 @@ static int smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,<br>
                                                      struct smu_temperature_range *range)<br>
 {<br>
         struct amdgpu_device *adev = smu->adev;<br>
-       u32 aid_temp, xcd_temp;<br>
+       u32 aid_temp, xcd_temp, mem_temp;<br>
         uint32_t smu_version;<br>
         u32 ccd_temp = 0;<br>
         int ret;<br>
@@ -2119,13 +2119,14 @@ static int smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,<br>
         if (ret)<br>
                 goto failed;<br>
 <br>
-       range->hotspot_crit_max = max3(aid_temp, xcd_temp, ccd_temp);<br>
+       range->hotspot_crit_max = max3(aid_temp, xcd_temp, ccd_temp) *<br>
+                                      SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
         ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GetCTFLimit,<br>
-                                             PPSMC_HBM_THM_TYPE, &range->mem_crit_max);<br>
+                                             PPSMC_HBM_THM_TYPE, &mem_temp);<br>
         if (ret)<br>
                 goto failed;<br>
 <br>
-       return 0;<br>
+       range->mem_crit_max = mem_temp * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
 failed:<br>
         return ret;<br>
 }<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</div>
</div>
</body>
</html>