[PATCH] drm/amd/pm: Remove unavailable temperature params

Wang, Yang(Kevin) KevinYang.Wang at amd.com
Thu Mar 9 11:41:27 UTC 2023


[AMD Official Use Only - General]

we'd better to add other patches to avoid create HWMON node file "temp_inputX" when smu doesn't support sensor type of AMDGPU_PP_SENSOR_EDGE_TEMP.

Reviewed-by: Yang Wang <kevinyang.wang at amd.com>

Best Regards,
Kevin

________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Lijo Lazar <lijo.lazar at amd.com>
Sent: Thursday, March 9, 2023 5:51 PM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>
Subject: [PATCH] drm/amd/pm: Remove unavailable temperature params

Temperature limits are not available for SMU v13.0.6. Also, edge
temperature is not tracked. Remove logic associated with those.

Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>
---
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c  | 43 -------------------
 1 file changed, 43 deletions(-)

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
index 862859bfb9e1..54d36df1306f 100644
--- 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
@@ -82,12 +82,6 @@

 #define smnPCIE_ESM_CTRL 0x111003D0

-static const struct smu_temperature_range smu_v13_0_6_thermal_policy[] = {
-       { -273150, 99000, 99000, -273150, 99000, 99000, -273150, 99000, 99000 },
-       { 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000,
-         120000 },
-};
-
 static const struct cmn2asic_msg_mapping smu_v13_0_6_message_map[SMU_MSG_MAX_COUNT] = {
         MSG_MAP(TestMessage,                         PPSMC_MSG_TestMessage,                      0),
         MSG_MAP(GetSmuVersion,                       PPSMC_MSG_GetSmuVersion,                    1),
@@ -701,9 +695,6 @@ static int smu_v13_0_6_get_smu_metrics_data(struct smu_context *smu,
         case METRICS_AVERAGE_SOCKETPOWER:
                 *value = SMUQ10_TO_UINT(metrics->SocketPower) << 8;
                 break;
-       case METRICS_TEMPERATURE_EDGE:
-               *value = 0;
-               break;
         case METRICS_TEMPERATURE_HOTSPOT:
                 *value = SMUQ10_TO_UINT(metrics->MaxSocketTemperature);
                 break;
@@ -1127,33 +1118,6 @@ static int smu_v13_0_6_force_clk_levels(struct smu_context *smu,
         return ret;
 }

-static int
-smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,
-                                         struct smu_temperature_range *range)
-{
-       uint8_t software_shutdown_temp;
-       uint8_t hotspotlimit;
-       uint8_t memlimit;
-
-       if (!range)
-               return -EINVAL;
-
-       /* TODO: Find a way to get temperature limits */
-       memcpy(range, &smu_v13_0_6_thermal_policy[0],
-              sizeof(struct smu_temperature_range));
-
-       range->hotspot_crit_max =
-               hotspotlimit * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
-       range->hotspot_emergency_max = (hotspotlimit + CTF_OFFSET_HOTSPOT) *
-                                      SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
-       range->mem_crit_max = memlimit * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
-       range->mem_emergency_max = (memlimit + CTF_OFFSET_MEM) *
-                                  SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
-       range->software_shutdown_temp = software_shutdown_temp;
-
-       return 0;
-}
-
 static int smu_v13_0_6_get_current_activity_percent(struct smu_context *smu,
                                                     enum amd_pp_sensors sensor,
                                                     uint32_t *value)
@@ -1204,10 +1168,6 @@ static int smu_v13_0_6_thermal_get_temperature(struct smu_context *smu,
                 ret = smu_v13_0_6_get_smu_metrics_data(
                         smu, METRICS_TEMPERATURE_HOTSPOT, value);
                 break;
-       case AMDGPU_PP_SENSOR_EDGE_TEMP:
-               ret = smu_v13_0_6_get_smu_metrics_data(
-                       smu, METRICS_TEMPERATURE_EDGE, value);
-               break;
         case AMDGPU_PP_SENSOR_MEM_TEMP:
                 ret = smu_v13_0_6_get_smu_metrics_data(
                         smu, METRICS_TEMPERATURE_MEM, value);
@@ -1244,7 +1204,6 @@ static int smu_v13_0_6_read_sensor(struct smu_context *smu,
                 *size = 4;
                 break;
         case AMDGPU_PP_SENSOR_HOTSPOT_TEMP:
-       case AMDGPU_PP_SENSOR_EDGE_TEMP:
         case AMDGPU_PP_SENSOR_MEM_TEMP:
                 ret = smu_v13_0_6_thermal_get_temperature(smu, sensor,
                                                           (uint32_t *)data);
@@ -2048,8 +2007,6 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
         /* dpm/clk tables */
         .set_default_dpm_table = smu_v13_0_6_set_default_dpm_table,
         .populate_umd_state_clk = smu_v13_0_6_populate_umd_state_clk,
-       .get_thermal_temperature_range =
-               smu_v13_0_6_get_thermal_temperature_range,
         .print_clk_levels = smu_v13_0_6_print_clk_levels,
         .force_clk_levels = smu_v13_0_6_force_clk_levels,
         .read_sensor = smu_v13_0_6_read_sensor,
--
2.25.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20230309/70c87a9d/attachment.htm>


More information about the amd-gfx mailing list