<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);">
Might want to add:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Bug: <a href="https://gitlab.freedesktop.org/drm/amd/-/issues/1267" id="LPlnk693456">
https://gitlab.freedesktop.org/drm/amd/-/issues/1267</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
with that, the series is:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-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> Friday, August 21, 2020 12:42 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 1/3] drm/amd/pm: correct Vega10 swctf limit setting</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Correct the Vega10 thermal swctf limit.<br>
<br>
Change-Id: I220c18bcb0772bfb8cb674337bac6dccafbd7698<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
---<br>
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c | 7 +++++--<br>
 1 file changed, 5 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 468bdd6f6697..ce9514c881ec 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>
@@ -363,6 +363,9 @@ int vega10_thermal_get_temperature(struct pp_hwmgr *hwmgr)<br>
 static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
                 struct PP_TemperatureRange *range)<br>
 {<br>
+       struct phm_ppt_v2_information *pp_table_info =<br>
+               (struct phm_ppt_v2_information *)(hwmgr->pptable);<br>
+       struct phm_tdp_table *tdp_table = pp_table_info->tdp_table;<br>
         struct amdgpu_device *adev = hwmgr->adev;<br>
         int low = VEGA10_THERMAL_MINIMUM_ALERT_TEMP *<br>
                         PP_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
@@ -372,8 +375,8 @@ static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
 <br>
         if (low < range->min)<br>
                 low = range->min;<br>
-       if (high > range->max)<br>
-               high = range->max;<br>
+       if (high > tdp_table->usSoftwareShutdownTemp)<br>
+               high = tdp_table->usSoftwareShutdownTemp;<br>
 <br>
         if (low > high)<br>
                 return -EINVAL;<br>
-- <br>
2.28.0<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>