[PATCH] drm/amd/pm: do not issue message while write "r" into pp_od_clk_voltage

Deucher, Alexander Alexander.Deucher at amd.com
Wed Feb 10 13:40:00 UTC 2021


[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: Huang, Ray <Ray.Huang at amd.com>
Sent: Tuesday, February 9, 2021 11:41 PM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Du, Xiaojian <Xiaojian.Du at amd.com>; Huang, Ray <Ray.Huang at amd.com>
Subject: [PATCH] drm/amd/pm: do not issue message while write "r" into pp_od_clk_voltage

We should commit the value after restore them back to default as well.

$ echo "r" > pp_od_clk_voltage
$ echo "c" > pp_od_clk_voltage

Signed-off-by: Huang Rui <ray.huang at amd.com>
---
 .../drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c  | 14 -------
 .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c  | 38 -------------------
 2 files changed, 52 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
index 88322781e447..ac7769087f98 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
@@ -1526,20 +1526,6 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr,

                 smu10_data->gfx_actual_soft_min_freq = min_freq;
                 smu10_data->gfx_actual_soft_max_freq = max_freq;
-
-               ret = smum_send_msg_to_smc_with_parameter(hwmgr,
-                                       PPSMC_MSG_SetHardMinGfxClk,
-                                       min_freq,
-                                       NULL);
-               if (ret)
-                       return ret;
-
-               ret = smum_send_msg_to_smc_with_parameter(hwmgr,
-                                       PPSMC_MSG_SetSoftMaxGfxClk,
-                                       max_freq,
-                                       NULL);
-               if (ret)
-                       return ret;
         } else if (type == PP_OD_COMMIT_DPM_TABLE) {
                 if (size != 0) {
                         pr_err("Input parameter number not correct\n");
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
index f0f06ef47b9e..9315f20da67f 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
@@ -1451,7 +1451,6 @@ static int vangogh_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TAB
                                         long input[], uint32_t size)
 {
         int ret = 0;
-       int i;
         struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);

         if (!(smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL)) {
@@ -1523,43 +1522,6 @@ static int vangogh_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TAB
                         smu->gfx_actual_soft_max_freq = smu->gfx_default_soft_max_freq;
                         smu->cpu_actual_soft_min_freq = smu->cpu_default_soft_min_freq;
                         smu->cpu_actual_soft_max_freq = smu->cpu_default_soft_max_freq;
-
-                       ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetHardMinGfxClk,
-                                                                       smu->gfx_actual_hard_min_freq, NULL);
-                       if (ret) {
-                               dev_err(smu->adev->dev, "Restore the default hard min sclk failed!");
-                               return ret;
-                       }
-
-                       ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetSoftMaxGfxClk,
-                                                                       smu->gfx_actual_soft_max_freq, NULL);
-                       if (ret) {
-                               dev_err(smu->adev->dev, "Restore the default soft max sclk failed!");
-                               return ret;
-                       }
-
-                       if (smu->adev->pm.fw_version < 0x43f1b00) {
-                               dev_warn(smu->adev->dev, "CPUSoftMax/CPUSoftMin are not supported, please update SBIOS!\n");
-                               break;
-                       }
-
-                       for (i = 0; i < smu->cpu_core_num; i++) {
-                               ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetSoftMinCclk,
-                                                                     (i << 20) | smu->cpu_actual_soft_min_freq,
-                                                                     NULL);
-                               if (ret) {
-                                       dev_err(smu->adev->dev, "Set hard min cclk failed!");
-                                       return ret;
-                               }
-
-                               ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetSoftMaxCclk,
-                                                                     (i << 20) | smu->cpu_actual_soft_max_freq,
-                                                                     NULL);
-                               if (ret) {
-                                       dev_err(smu->adev->dev, "Set soft max cclk failed!");
-                                       return ret;
-                               }
-                       }
                 }
                 break;
         case PP_OD_COMMIT_DPM_TABLE:
--
2.25.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20210210/61536473/attachment-0001.htm>


More information about the amd-gfx mailing list