Skip to contentSkip to conversation

drm/amd/pm: Fix critical temp unit of SMU v13.0.6

PATCH Superseded Asad Kamal 2 participants 2 messages Aug 18, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Asad Kamal

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Fix critical temp unit of SMU v13.0.6

Critical Temperature needs to be reported in
millidegree Celsius.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +5 -3
index 7d8af9b309b7..32da779dbd27 100644
@@ -2086,7 +2086,7 @@ static int smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,
 						     struct smu_temperature_range *range)
 {
 	struct amdgpu_device *adev = smu->adev;
-	u32 aid_temp, xcd_temp;
+	u32 aid_temp, xcd_temp, mem_temp;
 	uint32_t smu_version;
 	u32 ccd_temp = 0;
 	int ret;
@@ -2119,9 +2119,11 @@ static int smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,
 	if (ret)
 		goto failed;
 
-	range->hotspot_crit_max = max3(aid_temp, xcd_temp, ccd_temp);
+	range->hotspot_crit_max = max3(aid_temp, xcd_temp, ccd_temp) *
+				       SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 	ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GetCTFLimit,
-					      PPSMC_HBM_THM_TYPE, &range->mem_crit_max);
+					      PPSMC_HBM_THM_TYPE, &mem_temp);
+	range->mem_crit_max = mem_temp * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 	if (ret)
 		goto failed;
 
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - General]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Asad Kamal
Sent: Friday, August 18, 2023 6:30 PM
To: [email protected]
Cc: Lazar, Lijo <[email protected]>; Kamal, Asad <[email protected]>; Ma, Le <[email protected]>; Zhang, Morris <[email protected]>; Arif, Maisam <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amd/pm: Fix critical temp unit of SMU v13.0.6

Critical Temperature needs to be reported in millidegree Celsius.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +6 -3
index 7d8af9b309b7..32da779dbd27 100644
@@ -2086,7 +2086,7 @@ static int smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,
                                                     struct smu_temperature_range *range)  {
        struct amdgpu_device *adev = smu->adev;
-       u32 aid_temp, xcd_temp;
+       u32 aid_temp, xcd_temp, mem_temp;
        uint32_t smu_version;
        u32 ccd_temp = 0;
        int ret;
@@ -2119,9 +2119,11 @@ static int smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,
        if (ret)
                goto failed;
 
-       range->hotspot_crit_max = max3(aid_temp, xcd_temp, ccd_temp);
+       range->hotspot_crit_max = max3(aid_temp, xcd_temp, ccd_temp) *
+                                      SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
        ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GetCTFLimit,
-                                             PPSMC_HBM_THM_TYPE, &range->mem_crit_max);
+                                             PPSMC_HBM_THM_TYPE, &mem_temp);
+       range->mem_crit_max = mem_temp *
+SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 

[kevin]:
You'd better check ret value first.

Best Regards,
Kevin

        if (ret)
                goto failed;

--
2.34.1