drm/amd/powerplay: fix message of SetHardMinByFreq failed when feature is disabled

Submitted by Wang, Kevin(Yang) on Aug. 13, 2019, 2:34 a.m.

Details

Message ID 20190813023347.8666-1-kevin1.wang@amd.com
State New
Headers show
Series "drm/amd/powerplay: fix message of SetHardMinByFreq failed when feature is disabled" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Wang, Kevin(Yang) Aug. 13, 2019, 2:34 a.m.
the direct send message to smc to set hard clokc will failed
when smc clock dpm feature is disabled.
so use function of smu_set_hard_freq_range to replace it.
the function will check feature enablement.

eg: when uclk (mclk) dpm feature is disabled on navi10
[  300.675901] amdgpu: [powerplay] failed send message: SetHardMinByFreq(28)
   param: 0x00020064 response 0xfffffffb

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

-- 
2.22.0

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 3a081acdf1a8..3a49cabf726f 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -1306,16 +1306,8 @@  smu_v11_0_display_clock_voltage_request(struct smu_context *smu,
 		if (clk_select == SMU_UCLK && smu->disable_uclk_switch)
 			return 0;
 
-		clk_id = smu_clk_get_index(smu, clk_select);
-		if (clk_id < 0) {
-			ret = -EINVAL;
-			goto failed;
-		}
-
-
 		mutex_lock(&smu->mutex);
-		ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetHardMinByFreq,
-			(clk_id << 16) | clk_freq);
+		ret = smu_set_hard_freq_range(smu, clk_select, 0, clk_freq);
 		mutex_unlock(&smu->mutex);
 
 		if(clk_select == SMU_UCLK)

Comments

Reviewed-by: Evan Quan <evan.quan@amd.com>


> -----Original Message-----

> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of

> Wang, Kevin(Yang)

> Sent: Tuesday, August 13, 2019 10:34 AM

> To: dl.srdc_lnx_nv10 <dl.srdc_lnx_nv10@amd.com>

> Cc: Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; Huang, Ray

> <Ray.Huang@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; amd-

> gfx@lists.freedesktop.org

> Subject: [PATCH] drm/amd/powerplay: fix message of SetHardMinByFreq

> failed when feature is disabled

> 

> the direct send message to smc to set hard clokc will failed

> when smc clock dpm feature is disabled.

> so use function of smu_set_hard_freq_range to replace it.

> the function will check feature enablement.

> 

> eg: when uclk (mclk) dpm feature is disabled on navi10

> [  300.675901] amdgpu: [powerplay] failed send message:

> SetHardMinByFreq(28)

>    param: 0x00020064 response 0xfffffffb

> 

> Signed-off-by: Kevin Wang <kevin1.wang@amd.com>

> ---

>  drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 10 +---------

>  1 file changed, 1 insertion(+), 9 deletions(-)

> 

> diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

> b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

> index 3a081acdf1a8..3a49cabf726f 100644

> --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

> +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

> @@ -1306,16 +1306,8 @@ smu_v11_0_display_clock_voltage_request(struct

> smu_context *smu,

>  		if (clk_select == SMU_UCLK && smu->disable_uclk_switch)

>  			return 0;

> 

> -		clk_id = smu_clk_get_index(smu, clk_select);

> -		if (clk_id < 0) {

> -			ret = -EINVAL;

> -			goto failed;

> -		}

> -

> -

>  		mutex_lock(&smu->mutex);

> -		ret = smu_send_smc_msg_with_param(smu,

> SMU_MSG_SetHardMinByFreq,

> -			(clk_id << 16) | clk_freq);

> +		ret = smu_set_hard_freq_range(smu, clk_select, 0, clk_freq);

>  		mutex_unlock(&smu->mutex);

> 

>  		if(clk_select == SMU_UCLK)

> --

> 2.22.0

> 

> _______________________________________________

> amd-gfx mailing list

> amd-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/amd-gfx