drm/amdgpu: Fix for GPU reset being blocked by KIQ I/O.
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +5 -0
@@ -1102,6 +1102,9 @@ uint32_t amdgpu_kiq_rreg(struct amdgpu_device *adev, uint32_t reg, uint32_t xcc_might_sleep ();while (r <1 && cnt++ <MAX_KIQ_REG_TRY ) { +if (amdgpu_in_reset (adev)) + goto failed_kiq_read; +msleep (MAX_KIQ_REG_BAILOUT_INTERVAL ); r =amdgpu_fence_wait_polling (ring, seq,MAX_KIQ_REG_WAIT ); }
@@ -1171,6 +1174,8 @@ void amdgpu_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint3might_sleep ();while (r <1 && cnt++ <MAX_KIQ_REG_TRY ) { +if (amdgpu_in_reset (adev)) + goto failed_kiq_write;msleep (MAX_KIQ_REG_BAILOUT_INTERVAL ); r =amdgpu_fence_wait_polling (ring, seq,MAX_KIQ_REG_WAIT );
Signature · 1 line
2.43.0
Quoted 5 lines · Heng Zhou
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_resetcheck during each KIQ register poll.Signed-off-by Heng Zhou <[email protected]>---
You should create such patches with git format-patch -v2 to create a version 2 field in the header. And, ideally, provide a small change log below the three dashes like so:
---
Changes in v2:
- foo
- bar
---
JFYI for the future; I guess this patch is fine for now.
Regards,
Philipp
Quoted 26 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 5 +++++
1 file changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-0@@ -1102,6 +1102,9 @@ uint32_t amdgpu_kiq_rreg(struct amdgpu_device *adev, uint32_t reg, uint32_t xcc_
might_sleep();
while (r < 1 && cnt++ <MAX_KIQ_REG_TRY) {drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3
-0+if (amdgpu_in_reset (adev)) + goto failed_kiq_read; +
msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
r =amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT); }drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-0@@ -1171,6 +1174,8 @@ void amdgpu_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint3
might_sleep();
while (r < 1 && cnt++ <MAX_KIQ_REG_TRY) {drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2
-0+if (amdgpu_in_reset (adev)) + goto failed_kiq_write;
msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
r =amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
Christian König
maintainerQuoted 10 lines · Philipp Stanner
Quoted 5 lines · Heng Zhou
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_resetcheck during each KIQ register poll.Signed-off-by Heng Zhou <[email protected]>---
You should create such patches with git format-patch -v2 to create a version 2 field in the header. And, ideally, provide a small change log below the three dashes like so:
Alternatively depending on your setup you can also directly use "git send-email -v2 ..." to send out the patch to the mailing list.
Quoted 8 lines
---
Changes in v2:
- foo
- bar
---JFYI for the future; I guess this patch is fine for now.
Yeah, agree feel free to add Reviewed-by: Christian König <[email protected]> and push.
Regards,
Christian.
Quoted 31 lines
Regards,
PhilippQuoted 26 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 5 +++++
1 file changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-0@@ -1102,6 +1102,9 @@ uint32_t amdgpu_kiq_rreg(struct amdgpu_device *adev, uint32_t reg, uint32_t xcc_
might_sleep();
while (r < 1 && cnt++ <MAX_KIQ_REG_TRY) {drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3
-0+if (amdgpu_in_reset (adev)) + goto failed_kiq_read; +
msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
r =amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT); }drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-0@@ -1171,6 +1174,8 @@ void amdgpu_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint3
might_sleep();
while (r < 1 && cnt++ <MAX_KIQ_REG_TRY) {drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2
-0+if (amdgpu_in_reset (adev)) + goto failed_kiq_write;
msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
r =amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);