From: Xiangliang Yu Date: Thu, 13 Dec 2018 07:34:12 +0000 (+0800) Subject: drm/amdgpu/psp: Fix can't detect psp INVOKE command failed X-Git-Tag: v5.15~6763^2~26^2~167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76223c5496a7cf10aef1971e4e6aff77abadd15a;p=platform%2Fkernel%2Flinux-starfive.git drm/amdgpu/psp: Fix can't detect psp INVOKE command failed There isn't ucode when executing INVOKE command, so current code can't check the failure of INVOKE command. Remove the ucode check. Signed-off-by: Xiangliang Yu Reviewed-by: Feifei Xu 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 2f126ea7..7f5ce37 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -140,10 +140,13 @@ psp_cmd_submit_buf(struct psp_context *psp, while (*((unsigned int *)psp->fence_buf) != index) msleep(1); - /* the status field must be 0 after FW is loaded */ - if (ucode && psp->cmd_buf_mem->resp.status) { - DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n", - psp->cmd_buf_mem->resp.status, ucode->ucode_id); + /* the status field must be 0 after psp command completion */ + if (psp->cmd_buf_mem->resp.status) { + if (ucode) + DRM_ERROR("failed to load ucode id (%d) ", + ucode->ucode_id); + DRM_ERROR("psp command failed and response status is (%d)\n", + psp->cmd_buf_mem->resp.status); return -EINVAL; }