]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/amd/pm: Fix critical temp unit of SMU v13.0.6
authorAsad Kamal <asad.kamal@amd.com>
Fri, 18 Aug 2023 10:23:36 +0000 (18:23 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 31 Aug 2023 21:59:32 +0000 (17:59 -0400)
Critical Temperature needs to be reported in
millidegree Celsius.

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

index 7d8af9b309b7f13c935c181f5a2b26ded00bab09..d3b578e6bc2aaa604b42191bb5c86d8530b7ab96 100644 (file)
@@ -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,13 +2119,14 @@ 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);
        if (ret)
                goto failed;
 
-       return 0;
+       range->mem_crit_max = mem_temp * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 failed:
        return ret;
 }