Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <lijo.lazar@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
48880f96 bcfa48ff

+24 -6
+21 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
··· 640 640 } 641 641 } 642 642 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 + 643 657 static int 644 658 psp_cmd_submit_buf(struct psp_context *psp, 645 659 struct amdgpu_firmware_info *ucode, ··· 713 699 dev_warn(psp->adev->dev, 714 700 "failed to load ucode %s(0x%X) ", 715 701 amdgpu_ucode_name(ucode->ucode_id), ucode->ucode_id); 716 - dev_warn(psp->adev->dev, 717 - "psp gfx command %s(0x%X) failed and response status is (0x%X)\n", 718 - psp_gfx_cmd_name(psp->cmd_buf_mem->cmd_id), psp->cmd_buf_mem->cmd_id, 719 - psp->cmd_buf_mem->resp.status); 702 + if (psp_err_warn(psp)) 703 + dev_warn( 704 + psp->adev->dev, 705 + "psp gfx command %s(0x%X) failed and response status is (0x%X)\n", 706 + psp_gfx_cmd_name(psp->cmd_buf_mem->cmd_id), 707 + psp->cmd_buf_mem->cmd_id, 708 + psp->cmd_buf_mem->resp.status); 720 709 /* If any firmware (including CAP) load fails under SRIOV, it should 721 710 * return failure to stop the VF from initializing. 722 711 * Also return failure in case of timeout
+3 -2
drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h
··· 464 464 #define PSP_ERR_UNKNOWN_COMMAND 0x00000100 465 465 466 466 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, 469 470 }; 470 471 471 472 #endif /* _PSP_TEE_GFX_IF_H_ */