Commit 4e8cb0c0 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: move those operations not needed for resume out

Since smu_smc_table_hw_init() is needed for both .hw_init and .resume.
By doing this, we can drop unnecessary operations on resume.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 02cf91c1
......@@ -1130,25 +1130,6 @@ static int smu_smc_table_hw_init(struct smu_context *smu,
if (ret)
return ret;
if (initialize) {
/* get boot_values from vbios to set revision, gfxclk, and etc. */
ret = smu_get_vbios_bootup_values(smu);
if (ret)
return ret;
ret = smu_setup_pptable(smu);
if (ret)
return ret;
/*
* Send msg GetDriverIfVersion to check if the return value is equal
* with DRIVER_IF_VERSION of smc header.
*/
ret = smu_check_fw_version(smu);
if (ret)
return ret;
}
ret = smu_set_driver_table_location(smu);
if (ret)
return ret;
......@@ -1236,10 +1217,20 @@ static int smu_start_smc_engine(struct smu_context *smu)
if (smu->ppt_funcs->check_fw_status) {
ret = smu->ppt_funcs->check_fw_status(smu);
if (ret)
if (ret) {
pr_err("SMC is not ready\n");
return ret;
}
}
/*
* Send msg GetDriverIfVersion to check if the return value is equal
* with DRIVER_IF_VERSION of smc header.
*/
ret = smu_check_fw_version(smu);
if (ret)
return ret;
return ret;
}
......@@ -1268,6 +1259,15 @@ static int smu_hw_init(void *handle)
if (!smu->pm_enabled)
return 0;
/* get boot_values from vbios to set revision, gfxclk, and etc. */
ret = smu_get_vbios_bootup_values(smu);
if (ret)
return ret;
ret = smu_setup_pptable(smu);
if (ret)
return ret;
ret = smu_feature_init_dpm(smu);
if (ret)
goto failed;
......
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