Commit 7b1ebbe856fc ("drm/amdgpu: Avoid kcq disable during reset")
made amdgpu_gfx_disable_kcq() and amdgpu_gfx_disable_kgq() skip the
KIQ unmap once a reset is in progress, since the reset tears down and
rebuilds the queues anyway. It did not cover the MES branch that
commit f7fb9d677faf ("drm/amdgpu/mes12: fix suspend issue") had added
to the same functions earlier.
When MES is hung, each of those unmap requests waits out the MES
submission timeout of about 2.1 seconds before failing, and the
failure is ignored, so recovery stalls for that long per queue for
nothing.
Skip the MES unmap during reset as well, matching the KIQ path.
Fixes: 7b1ebbe856fc ("drm/amdgpu: Avoid kcq disable during reset")
Suggested-by: Jatin Kataria <[email protected]>
Signed-off-by: Matt Turner <[email protected]>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index c5a2dcff5058..0e9456b57577 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -586,6 +586,10 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev, int
xcc_id)
int j;
if (adev->enable_mes) {
+ /* As below for KIQ: the reset tears down and rebuilds the
queues. */
+ if (amdgpu_in_reset(adev))
+ return 0;
+
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
j = i + xcc_id * adev->gfx.num_compute_rings;
amdgpu_mes_unmap_legacy_queue(adev,
@@ -636,6 +640,10 @@ int amdgpu_gfx_disable_kgq(struct amdgpu_device *adev, int
xcc_id)
int j;
if (adev->enable_mes) {
+ /* As below for KIQ: the reset tears down and rebuilds the
queues. */
+ if (amdgpu_in_reset(adev))
+ return 0;
+
if (amdgpu_gfx_is_master_xcc(adev, xcc_id)) {
for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
j = i + xcc_id * adev->gfx.num_gfx_rings;
--
2.56.1