Skip to contentSkip to conversation

drm/amdgpu: avoid soft lockup when waiting for RLC serdes (v2)

PATCH In review Pixel Ding 2 participants 2 messages Oct 25, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Pixel Ding

author
#0 lore raw

PATCH 2/7 drm/amdgpu: avoid soft lockup when waiting for RLC serdes (v2)

From: pding <[email protected]>

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

v2:
- set the se_sh to broadcase before return

---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 8 ++++++++
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 ++++++++
 2 files changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +8 -0
index 4a0cf53..e0b7876 100644
@@ -3842,6 +3842,14 @@ static void gfx_v8_0_wait_for_rlc_serdes(struct amdgpu_device *adev)
 					break;
 				udelay(1);
 			}
+			if (k == adev->usec_timeout) {
+				gfx_v8_0_select_se_sh(adev, 0xffffffff,
+						      0xffffffff, 0xffffffff);
+				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);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +8 -0
index 060a6ff..39b02e9 100644
@@ -1628,6 +1628,14 @@ static void gfx_v9_0_wait_for_rlc_serdes(struct amdgpu_device *adev)
 					break;
 				udelay(1);
 			}
+			if (k == adev->usec_timeout) {
+				gfx_v9_0_select_se_sh(adev, 0xffffffff,
+						      0xffffffff, 0xffffffff);
+				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);
Signature · 6 lines
2.9.5

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by
#2 lore raw
In reply to a message not in the archive
Quoted 9 lines · Pixel Ding

From: pding <[email protected]>

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

v2:
- set the se_sh to broadcase before return

Quoted 46 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 8 ++++++++
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 ++++++++
 2 files changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +8 -0
index 4a0cf53..e0b7876 100644
@@ -3842,6 +3842,14 @@ static void gfx_v8_0_wait_for_rlc_serdes(struct amdgpu_device *adev)
                                        break;
                                udelay(1);
                        }
+                       if (k == adev->usec_timeout) {
+                               gfx_v8_0_select_se_sh(adev, 0xffffffff,
+                                                     0xffffffff, 0xffffffff);
+                               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);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +8 -1
index 060a6ff..39b02e9 100644
@@ -1628,6 +1628,14 @@ static void gfx_v9_0_wait_for_rlc_serdes(struct amdgpu_device *adev)
                                        break;
                                udelay(1);
                        }
+                       if (k == adev->usec_timeout) {
+                               gfx_v9_0_select_se_sh(adev, 0xffffffff,
+                                                     0xffffffff, 0xffffffff);
+                               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

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx