Skip to content

Commit 48880f9

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Don't show false warning for reg list
If reg list is already loaded on PSP 13.0.2 SOCs, psp will give TEE_ERR_CANCEL response on second time load. Avoid printing warn message for it. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Feifei Xu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent bcfa48f commit 48880f9

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,20 @@ static const char *psp_gfx_cmd_name(enum psp_gfx_cmd_id cmd_id)
640640
}
641641
}
642642

643+
static bool psp_err_warn(struct psp_context *psp)
644+
{
645+
struct psp_gfx_cmd_resp *cmd = psp->cmd_buf_mem;
646+
647+
/* This response indicates reg list is already loaded */
648+
if (amdgpu_ip_version(psp->adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 2) &&
649+
cmd->cmd_id == GFX_CMD_ID_LOAD_IP_FW &&
650+
cmd->cmd.cmd_load_ip_fw.fw_type == GFX_FW_TYPE_REG_LIST &&
651+
cmd->resp.status == TEE_ERROR_CANCEL)
652+
return false;
653+
654+
return true;
655+
}
656+
643657
static int
644658
psp_cmd_submit_buf(struct psp_context *psp,
645659
struct amdgpu_firmware_info *ucode,
@@ -699,10 +713,13 @@ psp_cmd_submit_buf(struct psp_context *psp,
699713
dev_warn(psp->adev->dev,
700714
"failed to load ucode %s(0x%X) ",
701715
amdgpu_ucode_name(ucode->ucode_id), ucode->ucode_id);
702-
dev_warn(psp->adev->dev,
703-
"psp gfx command %s(0x%X) failed and response status is (0x%X)\n",
704-
psp_gfx_cmd_name(psp->cmd_buf_mem->cmd_id), psp->cmd_buf_mem->cmd_id,
705-
psp->cmd_buf_mem->resp.status);
716+
if (psp_err_warn(psp))
717+
dev_warn(
718+
psp->adev->dev,
719+
"psp gfx command %s(0x%X) failed and response status is (0x%X)\n",
720+
psp_gfx_cmd_name(psp->cmd_buf_mem->cmd_id),
721+
psp->cmd_buf_mem->cmd_id,
722+
psp->cmd_buf_mem->resp.status);
706723
/* If any firmware (including CAP) load fails under SRIOV, it should
707724
* return failure to stop the VF from initializing.
708725
* Also return failure in case of timeout

drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,9 @@ struct psp_gfx_rb_frame
464464
#define PSP_ERR_UNKNOWN_COMMAND 0x00000100
465465

466466
enum tee_error_code {
467-
TEE_SUCCESS = 0x00000000,
468-
TEE_ERROR_NOT_SUPPORTED = 0xFFFF000A,
467+
TEE_SUCCESS = 0x00000000,
468+
TEE_ERROR_CANCEL = 0xFFFF0002,
469+
TEE_ERROR_NOT_SUPPORTED = 0xFFFF000A,
469470
};
470471

471472
#endif /* _PSP_TEE_GFX_IF_H_ */

0 commit comments

Comments
 (0)