diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index c1b862016245..7e3e1d588d74 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |||
@@ -120,6 +120,7 @@ psp_cmd_submit_buf(struct psp_context *psp, | |||
120 | { | 120 | { |
121 | int ret; | 121 | int ret; |
122 | int index; | 122 | int index; |
123 | int timeout = 2000; | ||
123 | 124 | ||
124 | memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE); | 125 | memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE); |
125 | 126 | ||
@@ -133,8 +134,11 @@ psp_cmd_submit_buf(struct psp_context *psp, | |||
133 | return ret; | 134 | return ret; |
134 | } | 135 | } |
135 | 136 | ||
136 | while (*((unsigned int *)psp->fence_buf) != index) | 137 | while (*((unsigned int *)psp->fence_buf) != index) { |
138 | if (--timeout == 0) | ||
139 | return -EINVAL; | ||
137 | msleep(1); | 140 | msleep(1); |
141 | } | ||
138 | 142 | ||
139 | /* In some cases, psp response status is not 0 even there is no | 143 | /* In some cases, psp response status is not 0 even there is no |
140 | * problem while the command is submitted. Some version of PSP FW | 144 | * problem while the command is submitted. Some version of PSP FW |