Skip to content

Commit e1c0d2e

Browse files
Asad Kamalalexdeucher
authored andcommitted
drm/amd/pm: Fix critical temp unit of SMU v13.0.6
Critical Temperature needs to be reported in millidegree Celsius. Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Yang Wang <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3f16096 commit e1c0d2e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ static int smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,
20862086
struct smu_temperature_range *range)
20872087
{
20882088
struct amdgpu_device *adev = smu->adev;
2089-
u32 aid_temp, xcd_temp;
2089+
u32 aid_temp, xcd_temp, mem_temp;
20902090
uint32_t smu_version;
20912091
u32 ccd_temp = 0;
20922092
int ret;
@@ -2119,13 +2119,14 @@ static int smu_v13_0_6_get_thermal_temperature_range(struct smu_context *smu,
21192119
if (ret)
21202120
goto failed;
21212121

2122-
range->hotspot_crit_max = max3(aid_temp, xcd_temp, ccd_temp);
2122+
range->hotspot_crit_max = max3(aid_temp, xcd_temp, ccd_temp) *
2123+
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
21232124
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GetCTFLimit,
2124-
PPSMC_HBM_THM_TYPE, &range->mem_crit_max);
2125+
PPSMC_HBM_THM_TYPE, &mem_temp);
21252126
if (ret)
21262127
goto failed;
21272128

2128-
return 0;
2129+
range->mem_crit_max = mem_temp * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
21292130
failed:
21302131
return ret;
21312132
}

0 commit comments

Comments
 (0)