Skip to contentSkip to conversation

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

PATCH In review Dave Airlie 2 participants 2 messages Aug 4, 2010

Subsystems (2)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 i915: do not spin forever waiting for CRT detection on Ironlake.

From: Dave Airlie <[email protected]>

In general unbounded while loops waiting on hardware are a bad plan, nobody seems to have designed hardware that doesn't screw you at some point. This might be due to race condition between threads, and should be investigated further, however at least for now I can now VT switch and suspend/resume after plugging in a monitor after startup.

---
 drivers/gpu/drm/i915/intel_crt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_crt.c +3 -1
index ee0732b..7f0738f 100644
@@ -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)) {
Signature · 1 line
1.7.1
#1 lore raw
Quoted 8 lines · Dave Airlie

From: Dave Airlie <[email protected]>

In general unbounded while loops waiting on hardware are a bad plan, nobody seems to have designed hardware that doesn't screw you at some point. This might be due to race condition between threads, and should be investigated further, however at least for now I can now VT switch and suspend/resume after plugging in a monitor after startup.

I was also having this kind of hack during earlier enabling stage on some kind of Ironlake (I can't remember if it's develop machine or some final form factor laptop..), but later fixed it by disable hotplug detect at first (commit eceb784cec4dc0fcc2993d9ee4a7c0d111ada80a) that resolved issue for me. Cougarpoint seems need to disable DAC before detect, maybe you could try that too?

Signature · 3 lines
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx