From: Likun Gao Date: Mon, 18 May 2020 10:19:30 +0000 (+0800) Subject: drm/amdgpu: add condition to set MP1 state on gpu reset X-Git-Tag: baikal/mips/sdk5.9~13559^2^2~25 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=be64836e2318b6c94f936ba34e808680752b4f68;p=kernel.git drm/amdgpu: add condition to set MP1 state on gpu reset Only ras supportted need to set MP1 state to prepare for unload before reloading SMU FW. Signed-off-by: Likun Gao Reviewed-by: Evan Quan Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index ddb4af0cc7020..7301fdcfb8bce 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -1552,12 +1552,13 @@ static int psp_load_smu_fw(struct psp_context *psp) struct amdgpu_device* adev = psp->adev; struct amdgpu_firmware_info *ucode = &adev->firmware.ucode[AMDGPU_UCODE_ID_SMC]; + struct amdgpu_ras *ras = psp->ras.ras; if (!ucode->fw || amdgpu_sriov_vf(psp->adev)) return 0; - if (adev->in_gpu_reset) { + if (adev->in_gpu_reset && ras && ras->supported) { ret = amdgpu_dpm_set_mp1_state(adev, PP_MP1_STATE_UNLOAD); if (ret) { DRM_WARN("Failed to set MP1 state prepare for reload\n");