Skip to content

Commit 690ae30

Browse files
Tiecheng Zhoualexdeucher
authored andcommitted
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: Evan Quan <[email protected]> Signed-off-by: Tiecheng Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 1e4a18c commit 690ae30

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/amd/powerplay/amd_powerplay.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,8 @@ static int pp_get_asic_baco_capability(void *handle, bool *cap)
14351435
if (!hwmgr)
14361436
return -EINVAL;
14371437

1438-
if (!hwmgr->pm_en || !hwmgr->hwmgr_func->get_asic_baco_capability)
1438+
if (!(hwmgr->not_vf && amdgpu_dpm) ||
1439+
!hwmgr->hwmgr_func->get_asic_baco_capability)
14391440
return 0;
14401441

14411442
mutex_lock(&hwmgr->smu_lock);
@@ -1469,7 +1470,8 @@ static int pp_set_asic_baco_state(void *handle, int state)
14691470
if (!hwmgr)
14701471
return -EINVAL;
14711472

1472-
if (!hwmgr->pm_en || !hwmgr->hwmgr_func->set_asic_baco_state)
1473+
if (!(hwmgr->not_vf && amdgpu_dpm) ||
1474+
!hwmgr->hwmgr_func->set_asic_baco_state)
14731475
return 0;
14741476

14751477
mutex_lock(&hwmgr->smu_lock);

0 commit comments

Comments
 (0)