diff mbox

[1/9] drm/i915: ensure rps state is properly lock-protected

Message ID 1343165630-21604-2-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter July 24, 2012, 9:33 p.m. UTC
Pure paranoia-induced patch as part of a large work to fix up the
locking around intel_mark_busy/idle. At least for the gen6+ rps state,
locking seems to be sane and the hw/sw state is protected by
dev->struct_mutex.

The only thing missing is a paranoid WARN_ON in sanitize_pm.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_pm.c |    2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 85d1b1c..b6e8fbf 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3745,6 +3745,8 @@  static void gen6_sanitize_pm(struct drm_device *dev)
 
 	gen6_gt_force_wake_get(dev_priv);
 
+	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
+
 	old = limits = I915_READ(GEN6_RP_INTERRUPT_LIMITS);
 	/* Make sure we continue to get interrupts
 	 * until we hit the minimum or maximum frequencies.