Commit 60adad6f authored by Kevin Wang's avatar Kevin Wang Committed by Alex Deucher

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: default avatarKevin Wang <kevin1.wang@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3f513bae
...@@ -1274,7 +1274,6 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu, ...@@ -1274,7 +1274,6 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu,
int ret = 0; int ret = 0;
enum smu_clk_type clk_select = 0; enum smu_clk_type clk_select = 0;
uint32_t clk_freq = clock_req->clock_freq_in_khz / 1000; uint32_t clk_freq = clock_req->clock_freq_in_khz / 1000;
int clk_id;
if (!smu->pm_enabled) if (!smu->pm_enabled)
return -EINVAL; return -EINVAL;
...@@ -1309,16 +1308,8 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu, ...@@ -1309,16 +1308,8 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu,
if (clk_select == SMU_UCLK && smu->disable_uclk_switch) if (clk_select == SMU_UCLK && smu->disable_uclk_switch)
return 0; return 0;
clk_id = smu_clk_get_index(smu, clk_select);
if (clk_id < 0) {
ret = -EINVAL;
goto failed;
}
mutex_lock(&smu->mutex); mutex_lock(&smu->mutex);
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetHardMinByFreq, ret = smu_set_hard_freq_range(smu, clk_select, clk_freq, 0);
(clk_id << 16) | clk_freq);
mutex_unlock(&smu->mutex); mutex_unlock(&smu->mutex);
if(clk_select == SMU_UCLK) if(clk_select == SMU_UCLK)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment