From: pding <pixel.d...@amd.com>

Normally all waiting get timeout if there's one.
Release the lock and return immediately when timeout happens.

Signed-off-by: pding <pixel.d...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 6 ++++++
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index fd38cb1..61753a3 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -3842,6 +3842,12 @@ static void gfx_v8_0_wait_for_rlc_serdes(struct 
amdgpu_device *adev)
                                        break;
                                udelay(1);
                        }
+                       if (k == adev->usec_timeout) {
+                               mutex_unlock(&adev->grbm_idx_mutex);
+                               DRM_INFO("Timeout wait for RLC serdes %u,%u\n",
+                                        i, j);
+                               return;
+                       }
                }
        }
        gfx_v8_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 50124ab..a2c67f6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1628,6 +1628,12 @@ static void gfx_v9_0_wait_for_rlc_serdes(struct 
amdgpu_device *adev)
                                        break;
                                udelay(1);
                        }
+                       if (k == adev->usec_timeout) {
+                               mutex_unlock(&adev->grbm_idx_mutex);
+                               DRM_INFO("Timeout wait for RLC serdes %u,%u\n",
+                                        i, j);
+                               return;
+                       }
                }
        }
        gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
-- 
2.9.5

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to