i915: do not spin forever waiting for CRT detection on Ironlake.
diff mbox

Message ID 1280893861-7771-1-git-send-email-airlied@gmail.com
State Deferred, archived
Headers show

Commit Message

Dave Airlie Aug. 4, 2010, 3:51 a.m. UTC
None

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index ee0732b..7f0738f 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -160,6 +160,7 @@  static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 adpa, temp;
 	bool ret;
+	u32 retry_count;
 
 	temp = adpa = I915_READ(PCH_ADPA);
 
@@ -185,7 +186,8 @@  static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
 	DRM_DEBUG_KMS("pch crt adpa 0x%x", adpa);
 	I915_WRITE(PCH_ADPA, adpa);
 
-	while ((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) != 0)
+	retry_count = 0;
+	while (((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) != 0) && (retry_count++ < 10000))
 		;
 
 	if (HAS_PCH_CPT(dev)) {