Skip to contentSkip to conversation

drm/amd/pm: correct MGpuFanBoost setting

PATCH In review Evan Quan 3 participants 6 messages May 18, 2021 – May 20, 2021

Subsystems (3)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/pm: correct MGpuFanBoost setting

No MGpuFanBoost setting for those ASICs which do not support it. Otherwise, it may breaks their fan control feature.

Change-Id Ifa9c87ac537a07937a0f0f6a670f21368eb29218
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c        |  9 +++++++++
 .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c    | 10 ++++++++++
 2 files changed, 19 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +9 -0
index d2063b1e7936..f16c76038f13 100644
@@ -2936,6 +2936,8 @@ static ssize_t navi1x_get_gpu_metrics(struct smu_context *smu,
 
 static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)
 {
+	struct smu_table_context *table_context = &smu->smu_table;
+	PPTable_t *smc_pptable = table_context->driver_pptable;
 	struct amdgpu_device *adev = smu->adev;
 	uint32_t param = 0;
 
@@ -2943,6 +2945,13 @@ static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)
 	if (adev->asic_type == CHIP_NAVI12)
 		return 0;
 
+	/*
+	 * Skip the MGpuFanBoost setting for those ASICs
+	 * which do not support it
+	 */
+	if (!smc_pptable->MGpuFanBoostLimitRpm)
+		return 0;
+
 	/* Workaround for WS SKU */
 	if (adev->pdev->device == 0x7312 &&
 	    adev->pdev->revision == 0)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +10 -0
index 3c3a7f9233e0..159cd698323e 100644
@@ -3201,6 +3201,16 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
 
 static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu)
 {
+	struct smu_table_context *table_context = &smu->smu_table;
+	PPTable_t *smc_pptable = table_context->driver_pptable;
+
+	/*
+	 * Skip the MGpuFanBoost setting for those ASICs
+	 * which do not support it
+	 */
+	if (!smc_pptable->MGpuFanBoostLimitRpm)
+		return 0;
+
 	return smu_cmn_send_smc_msg_with_param(smu,
 					       SMU_MSG_SetMGpuFanBoostLimitRpm,
 					       0,
Signature · 6 lines
2.29.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only]

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, May 18, 2021 10:05 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: correct MGpuFanBoost setting

No MGpuFanBoost setting for those ASICs which do not support it. Otherwise, it may breaks their fan control feature.

Change-Id Ifa9c87ac537a07937a0f0f6a670f21368eb29218
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c        |  9 +++++++++
 .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c    | 10 ++++++++++
 2 files changed, 19 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +9 -0
index d2063b1e7936..f16c76038f13 100644
@@ -2936,6 +2936,8 @@ static ssize_t navi1x_get_gpu_metrics(struct smu_context *smu,
 
 static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)  {
+	struct smu_table_context *table_context = &smu->smu_table;
+	PPTable_t *smc_pptable = table_context->driver_pptable;
 	struct amdgpu_device *adev = smu->adev;
 	uint32_t param = 0;
 
@@ -2943,6 +2945,13 @@ static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)
 	if (adev->asic_type == CHIP_NAVI12)
 		return 0;
 
+	/*
+	 * Skip the MGpuFanBoost setting for those ASICs
+	 * which do not support it
+	 */
+	if (!smc_pptable->MGpuFanBoostLimitRpm)
+		return 0;
+
 	/* Workaround for WS SKU */
 	if (adev->pdev->device == 0x7312 &&
 	    adev->pdev->revision == 0)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +10 -1
index 3c3a7f9233e0..159cd698323e 100644
@@ -3201,6 +3201,16 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
 
 static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu)  {
+	struct smu_table_context *table_context = &smu->smu_table;
+	PPTable_t *smc_pptable = table_context->driver_pptable;
+
+	/*
+	 * Skip the MGpuFanBoost setting for those ASICs
+	 * which do not support it
+	 */
+	if (!smc_pptable->MGpuFanBoostLimitRpm)
+		return 0;
+
 	return smu_cmn_send_smc_msg_with_param(smu,
 					       SMU_MSG_SetMGpuFanBoostLimitRpm,
 					       0,
--

2.29.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw

Do we need a similar check in the vega powerplay code?

Alex

Quoted 69 lines · Kenneth

[AMD Official Use Only]

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, May 18, 2021 10:05 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: correct MGpuFanBoost setting

No MGpuFanBoost setting for those ASICs which do not support it. Otherwise, it may breaks their fan control feature.

Change-Id Ifa9c87ac537a07937a0f0f6a670f21368eb29218
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c        |  9 +++++++++
 .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c    | 10 ++++++++++
 2 files changed, 19 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +9 -0
index d2063b1e7936..f16c76038f13 100644
@@ -2936,6 +2936,8 @@ static ssize_t navi1x_get_gpu_metrics(struct smu_context *smu,
 
 static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)  {
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *smc_pptable = table_context->driver_pptable;
        struct amdgpu_device *adev = smu->adev;
        uint32_t param = 0;
 
@@ -2943,6 +2945,13 @@ static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)
        if (adev->asic_type == CHIP_NAVI12)
                return 0;
 
+       /*
+        * Skip the MGpuFanBoost setting for those ASICs
+        * which do not support it
+        */
+       if (!smc_pptable->MGpuFanBoostLimitRpm)
+               return 0;
+
        /* Workaround for WS SKU */
        if (adev->pdev->device == 0x7312 &&
            adev->pdev->revision == 0)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +10 -1
index 3c3a7f9233e0..159cd698323e 100644
@@ -3201,6 +3201,16 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
 
 static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu)  {
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *smc_pptable = table_context->driver_pptable;
+
+       /*
+        * Skip the MGpuFanBoost setting for those ASICs
+        * which do not support it
+        */
+       if (!smc_pptable->MGpuFanBoostLimitRpm)
+               return 0;
+
        return smu_cmn_send_smc_msg_with_param(smu,
                                               SMU_MSG_SetMGpuFanBoostLimitRpm,
                                               0,
--
Quoted 5 lines

2.29.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#3 lore raw

Can also add:
Fixes: https://gitlab.freedesktop.org/drm/amd/-/issues/1580

Alex

Quoted 73 lines · Alex Deucher

Do we need a similar check in the vega powerplay code?

Alex

Quoted 66 lines · Kenneth

[AMD Official Use Only]

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, May 18, 2021 10:05 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: correct MGpuFanBoost setting

No MGpuFanBoost setting for those ASICs which do not support it. Otherwise, it may breaks their fan control feature.

Change-Id Ifa9c87ac537a07937a0f0f6a670f21368eb29218
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c        |  9 +++++++++
 .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c    | 10 ++++++++++
 2 files changed, 19 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +9 -0
index d2063b1e7936..f16c76038f13 100644
@@ -2936,6 +2936,8 @@ static ssize_t navi1x_get_gpu_metrics(struct smu_context *smu,
 
 static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)  {
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *smc_pptable = table_context->driver_pptable;
        struct amdgpu_device *adev = smu->adev;
        uint32_t param = 0;
 
@@ -2943,6 +2945,13 @@ static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)
        if (adev->asic_type == CHIP_NAVI12)
                return 0;
 
+       /*
+        * Skip the MGpuFanBoost setting for those ASICs
+        * which do not support it
+        */
+       if (!smc_pptable->MGpuFanBoostLimitRpm)
+               return 0;
+
        /* Workaround for WS SKU */
        if (adev->pdev->device == 0x7312 &&
            adev->pdev->revision == 0)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +10 -0
index 3c3a7f9233e0..159cd698323e 100644
@@ -3201,6 +3201,16 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
 
 static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu)  {
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *smc_pptable = table_context->driver_pptable;
+
+       /*
+        * Skip the MGpuFanBoost setting for those ASICs
+        * which do not support it
+        */
+       if (!smc_pptable->MGpuFanBoostLimitRpm)
+               return 0;
+
        return smu_cmn_send_smc_msg_with_param(smu,
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0 -1
                                               SMU_MSG_SetMGpuFanBoostLimitRpm,
                                               0,
--

2.29.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw
Quoted 3 lines · Alex Deucher

Can also add:
Fixes: https://gitlab.freedesktop.org/drm/amd/-/issues/1580

er,

Quoted 79 lines

Alex

Quoted 73 lines · Alex Deucher

Do we need a similar check in the vega powerplay code?

Alex

Quoted 66 lines · Kenneth

[AMD Official Use Only]

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, May 18, 2021 10:05 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: correct MGpuFanBoost setting

No MGpuFanBoost setting for those ASICs which do not support it. Otherwise, it may breaks their fan control feature.

Change-Id Ifa9c87ac537a07937a0f0f6a670f21368eb29218
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c        |  9 +++++++++
 .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c    | 10 ++++++++++
 2 files changed, 19 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +9 -0
index d2063b1e7936..f16c76038f13 100644
@@ -2936,6 +2936,8 @@ static ssize_t navi1x_get_gpu_metrics(struct smu_context *smu,
 
 static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)  {
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *smc_pptable = table_context->driver_pptable;
        struct amdgpu_device *adev = smu->adev;
        uint32_t param = 0;
 
@@ -2943,6 +2945,13 @@ static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)
        if (adev->asic_type == CHIP_NAVI12)
                return 0;
 
+       /*
+        * Skip the MGpuFanBoost setting for those ASICs
+        * which do not support it
+        */
+       if (!smc_pptable->MGpuFanBoostLimitRpm)
+               return 0;
+
        /* Workaround for WS SKU */
        if (adev->pdev->device == 0x7312 &&
            adev->pdev->revision == 0)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +10 -0
index 3c3a7f9233e0..159cd698323e 100644
@@ -3201,6 +3201,16 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
 
 static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu)  {
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *smc_pptable = table_context->driver_pptable;
+
+       /*
+        * Skip the MGpuFanBoost setting for those ASICs
+        * which do not support it
+        */
+       if (!smc_pptable->MGpuFanBoostLimitRpm)
+               return 0;
+
        return smu_cmn_send_smc_msg_with_param(smu,
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0 -1
                                               SMU_MSG_SetMGpuFanBoostLimitRpm,
                                               0,
--

2.29.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#5 lore raw
In reply to Alex Deucher

Thanks. I will check and port this to powerplay code if necessary.

BR
Evan

Quoted 114 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, May 19, 2021 10:13 AM
To: Feng, Kenneth <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/pm: correct MGpuFanBoost setting

Do we need a similar check in the vega powerplay code?

Alex

Quoted 13 lines · Kenneth

[AMD Official Use Only]

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, May 18, 2021 10:05 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: correct MGpuFanBoost setting

Quoted 7 lines

No MGpuFanBoost setting for those ASICs which do not support it. Otherwise, it may breaks their fan control feature.

Change-Id Ifa9c87ac537a07937a0f0f6a670f21368eb29218
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c        |  9

+++++++++

Quoted 1 line
 .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c    | 10

++++++++++

drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_enable_mgpu_fan_boost(struct

Quoted 17 lines
 2 files changed, 19 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +2 -0
index d2063b1e7936..f16c76038f13 100644
@@ -2936,6 +2936,8 @@ static ssize_t navi1x_get_gpu_metrics(struct
 smu_context *smu,
 
 static int navi10_enable_mgpu_fan_boost(struct smu_context *smu)  {
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *smc_pptable = table_context->driver_pptable;
        struct amdgpu_device *adev = smu->adev;
        uint32_t param = 0;
 
@@ -2943,6 +2945,13 @@ static int navi10_enable_mgpu_fan_boost(struct

smu_context *smu)

Quoted 36 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +7 -0
        if (adev->asic_type == CHIP_NAVI12)
                return 0;
 
+       /*
+        * Skip the MGpuFanBoost setting for those ASICs
+        * which do not support it
+        */
+       if (!smc_pptable->MGpuFanBoostLimitRpm)
+               return 0;
+
        /* Workaround for WS SKU */
        if (adev->pdev->device == 0x7312 &&
            adev->pdev->revision == 0) diff --git

a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index 3c3a7f9233e0..159cd698323e 100644

drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +10 -0
@@ -3201,6 +3201,16 @@ static ssize_t
 sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
 
 static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context
 *smu)  {
+       struct smu_table_context *table_context = &smu->smu_table;
+       PPTable_t *smc_pptable = table_context->driver_pptable;
+
+       /*
+        * Skip the MGpuFanBoost setting for those ASICs
+        * which do not support it
+        */
+       if (!smc_pptable->MGpuFanBoostLimitRpm)
+               return 0;
+
        return smu_cmn_send_smc_msg_with_param(smu,
                                               SMU_MSG_SetMGpuFanBoostLimitRpm,
                                               0,
Quoted 7 lines

--
2.29.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-

gfx&amp;data=04%7C01%7Cev

Quoted 1 line

an.quan%40amd.com%7Ca14d02e9c00a4d13acf808d91a6b9da0%7C3dd8961f e4884e6

Quoted 1 line

08e11a82d994e183d%7C0%7C0%7C637569871776869665%7CUnknown%7CT WFpbGZsb3d

Quoted 1 line

8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0% 3D%7C

Quoted 1 line

1000&amp;sdata=oo3glBV4Par2AylocfT3586Y1U%2FuePBureFdUOu7j%2BQ% 3D&amp;

Quoted 1 line

reserved=0

Quoted 11 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
freedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=04%7C01%7Cevan.quan%40amd.com%7Ca14d02e9c00a4d13a cf808d91a6b9da0%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63 7569871776869665%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata= oo3glBV4Par2AylocfT3586Y1U%2FuePBureFdUOu7j%2BQ%3D&amp;reserve d=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx