Skip to content

Commit 0c67342

Browse files
Heng Zhoualexdeucher
authored andcommitted
drm/amdgpu: Fix for GPU reset being blocked by KIQ I/O.
There is some probability that reset workqueue is blocked by KIQ I/O for 10+ seconds after gpu hangs. So we need to add a in_reset check during each KIQ register poll. Signed-off-by: Heng Zhou <Heng.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 0e190a0 commit 0c67342

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,9 @@ uint32_t amdgpu_kiq_rreg(struct amdgpu_device *adev, uint32_t reg, uint32_t xcc_
11021102

11031103
might_sleep();
11041104
while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
1105+
if (amdgpu_in_reset(adev))
1106+
goto failed_kiq_read;
1107+
11051108
msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
11061109
r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
11071110
}
@@ -1171,6 +1174,8 @@ void amdgpu_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint3
11711174

11721175
might_sleep();
11731176
while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
1177+
if (amdgpu_in_reset(adev))
1178+
goto failed_kiq_write;
11741179

11751180
msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
11761181
r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);

0 commit comments

Comments
 (0)