drm/amd/powerplay: avoid using pm_en before it is initialized revised
authorTiecheng Zhou <Tiecheng.Zhou@amd.com>
Sun, 26 Apr 2020 11:03:17 +0000 (19:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:20:15 +0000 (08:20 +0200)
commit65f3108cbb1d6505406e33269f618033a89667ed
tree38d660e1493d2850b2ce1469b9731798ff78dba1
parent8c5f11093ef45c36837f1ea0663fe3fefc8a3090
drm/amd/powerplay: avoid using pm_en before it is initialized revised

[ Upstream commit 690ae30be163d5262feae01335b2a6f30569e5aa ]

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 <evan.quan@amd.com>
Signed-off-by: Tiecheng Zhou <Tiecheng.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c