All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/amd/pm: Fix critical temp unit of SMU v13.0.6
@ 2023-08-18 11:00 Asad Kamal
  2023-08-18 11:24 ` Wang, Yang(Kevin)
  2023-08-18 11:28 ` Lazar, Lijo
  0 siblings, 2 replies; 3+ messages in thread
From: Asad Kamal @ 2023-08-18 11:00 UTC (permalink / raw)
  To: amd-gfx, KevinYang.Wang
  Cc: le.ma, Lijo.Lazar, asad.kamal, shiwu.zhang, hawking.zhang

Critical Temperature needs to be reported in
millidegree Celsius.

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 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 7d8af9b309b7..d3b578e6bc2a 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
@@ -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;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] drm/amd/pm: Fix critical temp unit of SMU v13.0.6
  2023-08-18 11:00 [PATCH v2] drm/amd/pm: Fix critical temp unit of SMU v13.0.6 Asad Kamal
@ 2023-08-18 11:24 ` Wang, Yang(Kevin)
  2023-08-18 11:28 ` Lazar, Lijo
  1 sibling, 0 replies; 3+ messages in thread
From: Wang, Yang(Kevin) @ 2023-08-18 11:24 UTC (permalink / raw)
  To: Kamal, Asad, amd-gfx
  Cc: Ma, Le, Lazar, Lijo, Kamal, Asad, Zhang, Morris, Zhang,  Hawking

[-- Attachment #1: Type: text/plain, Size: 2336 bytes --]

[AMD Official Use Only - General]

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

Best Regards,
Kevin
________________________________
发件人: Kamal, Asad <Asad.Kamal@amd.com>
发送时间: 星期五, 八月 18, 2023 19:01
收件人: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Wang, Yang(Kevin) <KevinYang.Wang@amd.com>
抄送: Lazar, Lijo <Lijo.Lazar@amd.com>; Zhang, Morris <Shiwu.Zhang@amd.com>; Kamal, Asad <Asad.Kamal@amd.com>; Ma, Le <Le.Ma@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>
主题: [PATCH v2] 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 <asad.kamal@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 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 7d8af9b309b7..d3b578e6bc2a 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
@@ -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;
 }
--
2.34.1


[-- Attachment #2: Type: text/html, Size: 5159 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] drm/amd/pm: Fix critical temp unit of SMU v13.0.6
  2023-08-18 11:00 [PATCH v2] drm/amd/pm: Fix critical temp unit of SMU v13.0.6 Asad Kamal
  2023-08-18 11:24 ` Wang, Yang(Kevin)
@ 2023-08-18 11:28 ` Lazar, Lijo
  1 sibling, 0 replies; 3+ messages in thread
From: Lazar, Lijo @ 2023-08-18 11:28 UTC (permalink / raw)
  To: Asad Kamal, amd-gfx, KevinYang.Wang; +Cc: le.ma, shiwu.zhang, hawking.zhang



On 8/18/2023 4:30 PM, Asad Kamal wrote:
> Critical Temperature needs to be reported in
> millidegree Celsius.
> 
> Signed-off-by: Asad Kamal <asad.kamal@amd.com>

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>

Thanks,
Lijo

> ---
>   drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 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 7d8af9b309b7..d3b578e6bc2a 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
> @@ -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;
>   }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-18 11:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-18 11:00 [PATCH v2] drm/amd/pm: Fix critical temp unit of SMU v13.0.6 Asad Kamal
2023-08-18 11:24 ` Wang, Yang(Kevin)
2023-08-18 11:28 ` Lazar, Lijo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.