<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">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" 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);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></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> Quan, Evan <Evan.Quan@amd.com><br>
<b>Sent:</b> Wednesday, August 26, 2020 3:45 AM<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><br>
<b>Subject:</b> [PATCH] drm/amd/pm: avoid false alarm due to confusing softwareshutdowntemp setting</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Normally softwareshutdowntemp should be greater than Thotspotlimit.<br>
However, on some VEGA10 ASIC, the softwareshutdowntemp is 91C while<br>
Thotspotlimit is 105C. This seems not right and may trigger some<br>
false alarms.<br>
<br>
Change-Id: I940cc6e450eebccd93ccdc3428187f6b7c09dcda<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
---<br>
 .../drm/amd/pm/powerplay/hwmgr/vega10_thermal.c    | 14 ++++++++++++--<br>
 1 file changed, 12 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c<br>
index d572ba4ec9b1..952cd3d7240e 100644<br>
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c<br>
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c<br>
@@ -374,8 +374,18 @@ static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
         /* compare them in unit celsius degree */<br>
         if (low < range->min / PP_TEMPERATURE_UNITS_PER_CENTIGRADES)<br>
                 low = range->min / PP_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
-       if (high > tdp_table->usSoftwareShutdownTemp)<br>
-               high = tdp_table->usSoftwareShutdownTemp;<br>
+<br>
+       /*<br>
+        * As a common sense, usSoftwareShutdownTemp should be bigger<br>
+        * than ThotspotLimit. For any invalid usSoftwareShutdownTemp,<br>
+        * we will just use the max possible setting VEGA10_THERMAL_MAXIMUM_ALERT_TEMP<br>
+        * to avoid false alarms.<br>
+        */<br>
+       if ((tdp_table->usSoftwareShutdownTemp ><br>
+            range->hotspot_crit_max / PP_TEMPERATURE_UNITS_PER_CENTIGRADES)) {<br>
+               if (high > tdp_table->usSoftwareShutdownTemp)<br>
+                       high = tdp_table->usSoftwareShutdownTemp;<br>
+       }<br>
 <br>
         if (low > high)<br>
                 return -EINVAL;<br>
-- <br>
2.28.0<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>