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.

Signed-off-by: Dave Airlie <[email protected]>
---
 drivers/gpu/drm/i915/intel_crt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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)) {
-- 
1.7.1

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

Reply via email to