Skip to content

Commit c520787

Browse files
Tiecheng Zhoualexdeucher
authored andcommitted
drm/amd/powerplay: avoid using pm_en before it is initialized
hwmgr->pm_en is initialized at hwmgr_hw_init. during amdgpu_device_init, there is amdgpu_asic_reset that calls to pp_get_asic_baco_capability, while hwmgr->pm_en has not yet been initialized. so avoid using pm_en in pp_get_asic_baco_capability. Reviewed-by: Emily Deng <[email protected]> Signed-off-by: Tiecheng Zhou <[email protected]> Signed-off-by: Yintian Tao <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 4ee2bb2 commit c520787

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,8 @@ static int pp_get_asic_baco_state(void *handle, int *state)
14521452
if (!hwmgr)
14531453
return -EINVAL;
14541454

1455-
if (!hwmgr->pm_en || !hwmgr->hwmgr_func->get_asic_baco_state)
1455+
if (!(hwmgr->not_vf && amdgpu_dpm) ||
1456+
!hwmgr->hwmgr_func->get_asic_baco_state)
14561457
return 0;
14571458

14581459
mutex_lock(&hwmgr->smu_lock);

0 commit comments

Comments
 (0)