mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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:
parent
82cfe59ba4
commit
c13ff09643
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user