This allows us to avoid the situation where worker is increasing the GPU
frequency after we've switched to idle.

v2: Do not access ->mm.busy under ->irq_lock
v3: Really do not access ->mm.busy under ->irq_lock

References: https://bugs.freedesktop.org/show_bug.cgi?id=89728
Cc: Chris Wilson <ch...@chris-wilson.co.uk>
Cc: Imre Deak <imre.d...@intel.com>
Cc: Daniel Vetter <dan...@ffwll.ch>
Signed-off-by: Michał Winiarski <michal.winiar...@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index f0d9414..03af766 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1089,6 +1089,9 @@ static void gen6_pm_rps_work(struct work_struct *work)
        int new_delay, adj, min, max;
        u32 pm_iir;
 
+       if (!dev_priv->mm.busy)
+               return;
+
        spin_lock_irq(&dev_priv->irq_lock);
        /* Speed up work cancelation during disabling rps interrupts. */
        if (!dev_priv->rps.interrupts_enabled) {
-- 
2.8.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to