DragonFlyBSD Kernel Audit
DF-1778 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/drm/radeon/radeon_dp_mst.c b/sys/dev/drm/radeon/radeon_dp_mst.c
--- a/sys/dev/drm/radeon/radeon_dp_mst.c
+++ b/sys/dev/drm/radeon/radeon_dp_mst.c
@@ -710,6 +710,7 @@
 	if (dig_connector->is_mst) {
 		u8 esi[16] = { 0 };
 		int dret;
+		int iters = 0;
 		int ret = 0;
 		bool handled;
 
@@ -732,8 +733,12 @@
 				dret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux,
 							DP_SINK_COUNT_ESI, esi, 8);
 				if (dret == 8) {
-					DRM_DEBUG_KMS("got esi2 %02x %02x %02x\n", esi[0], esi[1], esi[2]);
-					goto go_again;
+					if (++iters > 8) {
+						DRM_ERROR("MST ESI storm, giving up\n");
+					} else {
+						DRM_DEBUG_KMS("got esi2 %02x %02x %02x\n", esi[0], esi[1], esi[2]);
+						goto go_again;
+					}
 				}
 			} else
 				ret = 0;