<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:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
we'd better to add other patches to avoid create HWMON node file "temp_inputX" when smu doesn't support sensor type of <span style="font-family:"Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0">AMDGPU_PP_SENSOR_EDGE_TEMP.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><br>
</span></div>
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<font face="Segoe UI Web (West European), Segoe UI, -apple-system, BlinkMacSystemFont, Roboto, Helvetica Neue, sans-serif"><span style="font-size: 14.6667px;">Reviewed-by: Yang Wang <kevinyang.wang@amd.com></span></font></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0">Best Regards,</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0">Kevin</span></div>
<div id="appendonsend"></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 Lijo Lazar <lijo.lazar@amd.com><br>
<b>Sent:</b> Thursday, March 9, 2023 5:51 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>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/pm: Remove unavailable temperature params</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Temperature limits are not available for SMU v13.0.6. Also, edge<br>
temperature is not tracked. Remove logic associated with those.<br>
<br>
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com><br>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com><br>
---<br>
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c  | 43 -------------------<br>
 1 file changed, 43 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 862859bfb9e1..54d36df1306f 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>
@@ -82,12 +82,6 @@<br>
 <br>
 #define smnPCIE_ESM_CTRL 0x111003D0<br>
 <br>
-static const struct smu_temperature_range smu_v13_0_6_thermal_policy[] = {<br>
-       { -273150, 99000, 99000, -273150, 99000, 99000, -273150, 99000, 99000 },<br>
-       { 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000,<br>
-         120000 },<br>
-};<br>
-<br>
 static const struct cmn2asic_msg_mapping smu_v13_0_6_message_map[SMU_MSG_MAX_COUNT] = {<br>
         MSG_MAP(TestMessage,                         PPSMC_MSG_TestMessage,                      0),<br>
         MSG_MAP(GetSmuVersion,                       PPSMC_MSG_GetSmuVersion,                    1),<br>
@@ -701,9 +695,6 @@ static int smu_v13_0_6_get_smu_metrics_data(struct smu_context *smu,<br>
         case METRICS_AVERAGE_SOCKETPOWER:<br>
                 *value = SMUQ10_TO_UINT(metrics->SocketPower) << 8;<br>
                 break;<br>
-       case METRICS_TEMPERATURE_EDGE:<br>
-               *value = 0;<br>
-               break;<br>
         case METRICS_TEMPERATURE_HOTSPOT:<br>
                 *value = SMUQ10_TO_UINT(metrics->MaxSocketTemperature);<br>
                 break;<br>
@@ -1127,33 +1118,6 @@ static int smu_v13_0_6_force_clk_levels(struct smu_context *smu,<br>
         return ret;<br>
 }<br>
 <br>
-static int<br>
-smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,<br>
-                                         struct smu_temperature_range *range)<br>
-{<br>
-       uint8_t software_shutdown_temp;<br>
-       uint8_t hotspotlimit;<br>
-       uint8_t memlimit;<br>
-<br>
-       if (!range)<br>
-               return -EINVAL;<br>
-<br>
-       /* TODO: Find a way to get temperature limits */<br>
-       memcpy(range, &smu_v13_0_6_thermal_policy[0],<br>
-              sizeof(struct smu_temperature_range));<br>
-<br>
-       range->hotspot_crit_max =<br>
-               hotspotlimit * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
-       range->hotspot_emergency_max = (hotspotlimit + CTF_OFFSET_HOTSPOT) *<br>
-                                      SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
-       range->mem_crit_max = memlimit * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
-       range->mem_emergency_max = (memlimit + CTF_OFFSET_MEM) *<br>
-                                  SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
-       range->software_shutdown_temp = software_shutdown_temp;<br>
-<br>
-       return 0;<br>
-}<br>
-<br>
 static int smu_v13_0_6_get_current_activity_percent(struct smu_context *smu,<br>
                                                     enum amd_pp_sensors sensor,<br>
                                                     uint32_t *value)<br>
@@ -1204,10 +1168,6 @@ static int smu_v13_0_6_thermal_get_temperature(struct smu_context *smu,<br>
                 ret = smu_v13_0_6_get_smu_metrics_data(<br>
                         smu, METRICS_TEMPERATURE_HOTSPOT, value);<br>
                 break;<br>
-       case AMDGPU_PP_SENSOR_EDGE_TEMP:<br>
-               ret = smu_v13_0_6_get_smu_metrics_data(<br>
-                       smu, METRICS_TEMPERATURE_EDGE, value);<br>
-               break;<br>
         case AMDGPU_PP_SENSOR_MEM_TEMP:<br>
                 ret = smu_v13_0_6_get_smu_metrics_data(<br>
                         smu, METRICS_TEMPERATURE_MEM, value);<br>
@@ -1244,7 +1204,6 @@ static int smu_v13_0_6_read_sensor(struct smu_context *smu,<br>
                 *size = 4;<br>
                 break;<br>
         case AMDGPU_PP_SENSOR_HOTSPOT_TEMP:<br>
-       case AMDGPU_PP_SENSOR_EDGE_TEMP:<br>
         case AMDGPU_PP_SENSOR_MEM_TEMP:<br>
                 ret = smu_v13_0_6_thermal_get_temperature(smu, sensor,<br>
                                                           (uint32_t *)data);<br>
@@ -2048,8 +2007,6 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {<br>
         /* dpm/clk tables */<br>
         .set_default_dpm_table = smu_v13_0_6_set_default_dpm_table,<br>
         .populate_umd_state_clk = smu_v13_0_6_populate_umd_state_clk,<br>
-       .get_thermal_temperature_range =<br>
-               smu_v13_0_6_get_thermal_temperature_range,<br>
         .print_clk_levels = smu_v13_0_6_print_clk_levels,<br>
         .force_clk_levels = smu_v13_0_6_force_clk_levels,<br>
         .read_sensor = smu_v13_0_6_read_sensor,<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>