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

Daniel Vetter daniel.vetter at ffwll.ch
Tue Jul 24 23:33:42 CEST 2012


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 at ffwll.ch>
---
 drivers/gpu/drm/i915/intel_pm.c |    2 ++
 1 file changed, 2 insertions(+)

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.
-- 
1.7.10.4




More information about the Intel-gfx mailing list