]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: fix ras UE error injection failure issue
authorYiPeng Chai <YiPeng.Chai@amd.com>
Fri, 19 Jul 2024 12:43:04 +0000 (20:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Jul 2024 21:30:23 +0000 (17:30 -0400)
The ras command shared memory is allocated from
VRAM and the response status of the command
buffer will not be zero due to gpu being in
fatal error state after ras UE error injection.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 8284951a6e79c6806c675e5f68a4cd425dd56bc4)

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 7cdff355cedbd9aee36452d5290d0f2b1533a6ec..189574d53ebd30a7d37f3c2748624f9262707fb3 100644 (file)
@@ -1630,9 +1630,7 @@ static int psp_ras_send_cmd(struct psp_context *psp,
 
        switch (cmd) {
        case TA_RAS_COMMAND__TRIGGER_ERROR:
-               if (ret || psp->cmd_buf_mem->resp.status)
-                       ret = -EINVAL;
-               else if (out)
+               if (!ret && out)
                        memcpy(out, &ras_cmd->ras_status, sizeof(ras_cmd->ras_status));
                break;
        case TA_RAS_COMMAND__QUERY_ADDRESS: