Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/powerplay: simplify avfs control code in smu7

Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Eric Huang and committed by
Alex Deucher
35011d39 f9c993ce

+4 -5
+4 -5
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
··· 89 89 DPM_EVENT_SRC_DIGITAL_OR_EXTERNAL = 4 90 90 }; 91 91 92 + static int smu7_avfs_control(struct pp_hwmgr *hwmgr, bool enable); 92 93 static const unsigned long PhwVIslands_Magic = (unsigned long)(PHM_VIslands_Magic); 93 94 static int smu7_force_clock_level(struct pp_hwmgr *hwmgr, 94 95 enum pp_clock_type type, uint32_t mask); ··· 1310 1309 PP_ASSERT_WITH_CODE((tmp_result == 0), 1311 1310 "Failed to disable thermal auto throttle!", result = tmp_result); 1312 1311 1313 - if (1 == PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, FEATURE_STATUS, AVS_ON)) { 1314 - PP_ASSERT_WITH_CODE((0 == smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_DisableAvfs)), 1315 - "Failed to disable AVFS!", 1316 - return -EINVAL); 1317 - } 1312 + tmp_result = smu7_avfs_control(hwmgr, false); 1313 + PP_ASSERT_WITH_CODE((tmp_result == 0), 1314 + "Failed to disable AVFS!", result = tmp_result); 1318 1315 1319 1316 tmp_result = smu7_stop_dpm(hwmgr); 1320 1317 PP_ASSERT_WITH_CODE((tmp_result == 0),