public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: fix race when clearing RPS IIR bits
@ 2015-03-23 17:11 Imre Deak
  2015-03-23 17:11 ` [PATCH 2/2] drm/i915: move clearing of RPS interrupt bits from disable to reset time Imre Deak
  2015-03-23 21:10 ` [PATCH 1/2] drm/i915: fix race when clearing RPS IIR bits Chris Wilson
  0 siblings, 2 replies; 8+ messages in thread
From: Imre Deak @ 2015-03-23 17:11 UTC (permalink / raw)
  To: intel-gfx

When disabling RPS interrupts there is a race where we disable RPS
inerrupts while the interrupt handler is running and the handler has
already latched the pending RPS interrupt from the master IIR register.
Afterwards the disabling path clears the PM IIR bits, making the state
of pending interrupts inconsistent from the interrupt handler's point of
view. This triggers the following warning: "The master control interrupt
lied (PM)!".

To fix this make sure that any running interrupt handler (which may
have already latched the master IIR) finishes before clearing the IIR
bits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87347
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 6d8340d..7afbde4 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -330,6 +330,13 @@ void gen6_disable_rps_interrupts(struct drm_device *dev)
 	__gen6_disable_pm_irq(dev_priv, dev_priv->pm_rps_events);
 	I915_WRITE(gen6_pm_ier(dev_priv), I915_READ(gen6_pm_ier(dev_priv)) &
 				~dev_priv->pm_rps_events);
+
+	spin_unlock_irq(&dev_priv->irq_lock);
+
+	synchronize_irq(dev->irq);
+
+	spin_lock_irq(&dev_priv->irq_lock);
+
 	I915_WRITE(gen6_pm_iir(dev_priv), dev_priv->pm_rps_events);
 	I915_WRITE(gen6_pm_iir(dev_priv), dev_priv->pm_rps_events);
 
-- 
2.1.0

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-24 20:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 17:11 [PATCH 1/2] drm/i915: fix race when clearing RPS IIR bits Imre Deak
2015-03-23 17:11 ` [PATCH 2/2] drm/i915: move clearing of RPS interrupt bits from disable to reset time Imre Deak
2015-03-24  9:14   ` Daniel Vetter
2015-03-24 20:39   ` shuang.he
2015-03-23 21:10 ` [PATCH 1/2] drm/i915: fix race when clearing RPS IIR bits Chris Wilson
2015-03-24  9:14   ` Daniel Vetter
2015-03-24  9:24     ` Chris Wilson
2015-03-24 20:52       ` Imre Deak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox