Skip to contentSkip to conversation

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

PATCH In review Ben Widawsky 2 participants 3 messages Feb 24, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

On my Ironlake, I was consistently hitting this. I'm not yet sure what the best fix is, but this is better than what is there currently.

Jesse can probably do something better... perhaps even a delay before calling ironlake_disable_rc6() again would suffice.

---
 drivers/gpu/drm/i915/intel_display.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +5 -2
index 94622e3..32ac4f1 100644
@@ -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)
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 2 lines · Ben Widawsky

On my Ironlake, I was consistently hitting this. I'm not yet sure what the best fix is, but this is better than what is there currently.

Ha, recursive typo.

s/ironlake_disable_rc6/ironlake_teardown_rc6/
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#2 lore raw
Quoted 9 lines · Chris Wilson
Quoted 2 lines · Ben Widawsky

On my Ironlake, I was consistently hitting this. I'm not yet sure what the best fix is, but this is better than what is there currently.

Ha, recursive typo.

s/ironlake_disable_rc6/ironlake_teardown_rc6/
-Chris

Yup, that works too and looks a lot more correct. It really wasn't obvious to me last night though :-)

You can add, if you feel inclined.

Reported-and-tested-by Ben Widawsky <[email protected]>