From e2ba2e60e80daea3a1c1d5f01086883628b596f3 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Mon, 14 Jan 2019 16:08:32 +0800 Subject: [PATCH] drm/amdgpu/psp: ignore psp response status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In some cases, psp response status is not 0 even there is no problem while the command is submitted. Some version of PSP FW doesn't write 0 to that field. So here we would like to only print a warning instead of an error during psp initialization to avoid breaking hw_init and it doesn't return -EINVAL. Upstream commit id: 466bcb75b0791ba301817cdadeed20398f2224fe (Adam) Signed-off-by: Aaron Liu Reviewed-by: Huang Rui Reviewed-by: Xiangliang Yu Acked-by: Christian König Reviewed-by: Feifei Xu Reviewed-by: Paul Menzel Signed-off-by: Alex Deucher Signed-off-by: Adam Yang --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 3a9b48b227ac..30364b49a88c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -142,11 +142,19 @@ 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); - return -EINVAL; + /* In some cases, psp response status is not 0 even there is no + * problem while the command is submitted. Some version of PSP FW + * doesn't write 0 to that field. + * So here we would like to only print a warning instead of an error + * during psp initialization to avoid breaking hw_init and it doesn't + * return -EINVAL. + */ + if (psp->cmd_buf_mem->resp.status) { + if (ucode) + DRM_WARN("failed to load ucode id (%d) ", + ucode->ucode_id); + DRM_WARN("psp command failed and response status is (%d)\n", + psp->cmd_buf_mem->resp.status); } if (ucode) { -- 2.17.1