Commit dccf1eff authored by Monk Liu's avatar Monk Liu Committed by Alex Deucher

drm/amdgpu: give warning before sleep in kiq_r/wreg

to catch error that may schedule in atomic context early on
Signed-off-by: default avatarMonk Liu <Monk.Liu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 59dd4772
...@@ -167,6 +167,9 @@ uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device *adev, uint32_t reg) ...@@ -167,6 +167,9 @@ uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device *adev, uint32_t reg)
if (r < 1 && (adev->in_gpu_reset || in_interrupt())) if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
goto failed_kiq_read; goto failed_kiq_read;
if (in_interrupt())
might_sleep();
while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) { while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
msleep(MAX_KIQ_REG_BAILOUT_INTERVAL); msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT); r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
...@@ -212,7 +215,11 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v) ...@@ -212,7 +215,11 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v)
if (r < 1 && (adev->in_gpu_reset || in_interrupt())) if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
goto failed_kiq_write; goto failed_kiq_write;
if (in_interrupt())
might_sleep();
while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) { while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
msleep(MAX_KIQ_REG_BAILOUT_INTERVAL); msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT); r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
} }
......
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