From: John Clements Date: Thu, 7 May 2020 10:25:13 +0000 (+0800) Subject: drm/amdgpu: Fix bug in RAS invoke X-Git-Tag: baikal/mips/sdk5.9~13559^2~11^2~23 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=fa3c329c18043d52bee5ea64f5a59f6e17261017;p=kernel.git drm/amdgpu: Fix bug in RAS invoke Invoke sequence should abort when ras interrupt is detected before reading TA host shared memory Reviewed-by: Hawking Zhang Signed-off-by: John Clements 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 f061ad6750edd..cade87caed0b3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -759,15 +759,15 @@ int psp_ras_invoke(struct psp_context *psp, uint32_t ta_cmd_id) ret = psp_ta_invoke(psp, ta_cmd_id, psp->ras.session_id); + if (amdgpu_ras_intr_triggered()) + return ret; + if (ras_cmd->if_version > RAS_TA_HOST_IF_VER) { DRM_WARN("RAS: Unsupported Interface"); return -EINVAL; } - if (amdgpu_ras_intr_triggered()) - return ret; - if (!ret) { if (ras_cmd->ras_out_message.flags.err_inject_switch_disable_flag) { dev_warn(psp->adev->dev, "ECC switch disabled\n");