Commit ea114213 authored by xinhui pan's avatar xinhui pan Committed by Alex Deucher

drm/amdgpu: add psp cmd submit timeout

Signed-off-by: default avatarxinhui pan <xinhui.pan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3ea8fb8c
...@@ -120,6 +120,7 @@ psp_cmd_submit_buf(struct psp_context *psp, ...@@ -120,6 +120,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
{ {
int ret; int ret;
int index; int index;
int timeout = 2000;
memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE); memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE);
...@@ -133,8 +134,11 @@ psp_cmd_submit_buf(struct psp_context *psp, ...@@ -133,8 +134,11 @@ psp_cmd_submit_buf(struct psp_context *psp,
return ret; return ret;
} }
while (*((unsigned int *)psp->fence_buf) != index) while (*((unsigned int *)psp->fence_buf) != index) {
if (--timeout == 0)
return -EINVAL;
msleep(1); msleep(1);
}
/* In some cases, psp response status is not 0 even there is no /* In some cases, psp response status is not 0 even there is no
* problem while the command is submitted. Some version of PSP FW * problem while the command is submitted. Some version of PSP FW
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment