From 7f70443fd8340709caa6444420b8810757688f4d Mon Sep 17 00:00:00 2001 From: John Clements Date: Tue, 14 Apr 2020 15:22:29 +0800 Subject: [PATCH] drm/amdgpu: set mp1 state before reload Set MP1 state to prepare for unload before reloading SMU FW Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 ++++++++++- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 8d1c91b3d54a..8020f18d569d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -1384,12 +1384,21 @@ static int psp_execute_np_fw_load(struct psp_context *psp, static int psp_load_smu_fw(struct psp_context *psp) { int ret; + struct amdgpu_device* adev = psp->adev; struct amdgpu_firmware_info *ucode = - &psp->adev->firmware.ucode[AMDGPU_UCODE_ID_SMC]; + &adev->firmware.ucode[AMDGPU_UCODE_ID_SMC]; if (!ucode->fw || amdgpu_sriov_vf(psp->adev)) return 0; + + if (adev->in_gpu_reset) { + ret = amdgpu_dpm_set_mp1_state(adev, PP_MP1_STATE_UNLOAD); + if (ret) { + DRM_WARN("Failed to set MP1 state prepare for reload\n"); + } + } + ret = psp_execute_np_fw_load(psp, ucode); if (ret) diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index b502fcaf3c04..a96ea3e141dc 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c @@ -1700,12 +1700,6 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state) if (ret) goto out; - if (ras && ras->supported) { - ret = smu_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL); - if (ret) - goto out; - } - /* clear vbios scratch 6 and 7 for coming asic reinit */ WREG32(adev->bios_scratch_reg_offset + 6, 0); WREG32(adev->bios_scratch_reg_offset + 7, 0); -- 2.34.1