Commit c7833d33 authored by Tiecheng Zhou's avatar Tiecheng Zhou Committed by Alex Deucher

drm/amd/powerplay: avoid using pm_en before it is initialized revised

hwmgr->pm_en is initialized at hwmgr_hw_init.

during amdgpu_device_init, there is amdgpu_asic_reset that calls to
soc15_asic_reset (for V320 usecase, Vega10 asic), in which:
1) soc15_asic_reset_method calls to pp_get_asic_baco_capability (pm_en)
2) soc15_asic_baco_reset calls to pp_set_asic_baco_state (pm_en)

pm_en is used in the above two cases while it has not yet been initialized

So avoid using pm_en in the above two functions for V320 passthrough.
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarTiecheng Zhou <Tiecheng.Zhou@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a1cd1289
...@@ -1438,7 +1438,8 @@ static int pp_get_asic_baco_capability(void *handle, bool *cap) ...@@ -1438,7 +1438,8 @@ static int pp_get_asic_baco_capability(void *handle, bool *cap)
if (!hwmgr) if (!hwmgr)
return -EINVAL; return -EINVAL;
if (!hwmgr->pm_en || !hwmgr->hwmgr_func->get_asic_baco_capability) if (!(hwmgr->not_vf && amdgpu_dpm) ||
!hwmgr->hwmgr_func->get_asic_baco_capability)
return 0; return 0;
mutex_lock(&hwmgr->smu_lock); mutex_lock(&hwmgr->smu_lock);
...@@ -1472,7 +1473,8 @@ static int pp_set_asic_baco_state(void *handle, int state) ...@@ -1472,7 +1473,8 @@ static int pp_set_asic_baco_state(void *handle, int state)
if (!hwmgr) if (!hwmgr)
return -EINVAL; return -EINVAL;
if (!hwmgr->pm_en || !hwmgr->hwmgr_func->set_asic_baco_state) if (!(hwmgr->not_vf && amdgpu_dpm) ||
!hwmgr->hwmgr_func->set_asic_baco_state)
return 0; return 0;
mutex_lock(&hwmgr->smu_lock); mutex_lock(&hwmgr->smu_lock);
......
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