drm/amdgpu: check PSP response status in psp_ptl_invoke

Add an explicit check on cmd->resp.status after psp_cmd_submit_buf()
returns to ensure PTL state is only updated on actual success.

Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Perry Yuan 2026-02-10 13:50:36 +08:00 committed by Alex Deucher
parent 82cfe59ba4
commit c13ff09643

View File

@ -1270,6 +1270,18 @@ static int psp_ptl_invoke(struct psp_context *psp, u32 req_code,
if (ret)
goto out;
/*
* Check response status explicitly to avoid
* updating cached PTL state with invalid data.
*/
if (cmd->resp.status) {
dev_err(psp->adev->dev,
"PTL command 0x%x failed, PSP response status: 0x%X\n",
req_code, cmd->resp.status);
ret = -EIO;
goto out;
}
/* Parse response */
switch (req_code) {
case PSP_PTL_PERF_MON_QUERY: