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 <[email protected]>
---
 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

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

Reply via email to