diff mbox

drm/i915/display: stop potential rc6 disable infinite retries

Message ID 1298520047-3160-1-git-send-email-bwidawsk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky Feb. 24, 2011, 4 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 94622e3..32ac4f1 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6483,6 +6483,7 @@  static void ironlake_teardown_rc6(struct drm_device *dev)
 static void ironlake_disable_rc6(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	static int max_tries = 100;
 
 	if (I915_READ(PWRCTXA)) {
 		/* Wake the GPU, prevent RC6, then restore RSTDBYCTL */
@@ -6496,8 +6497,10 @@  static void ironlake_disable_rc6(struct drm_device *dev)
 		I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) & ~RCX_SW_EXIT);
 		POSTING_READ(RSTDBYCTL);
 	}
-
-	ironlake_disable_rc6(dev);
+	if (max_tries--)
+		ironlake_disable_rc6(dev);
+	else
+		DRM_DEBUG_DRIVER("Failed to disable RC6\n");
 }
 
 static int ironlake_setup_rc6(struct drm_device *dev)