Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: oscar.mateo@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/4] drm/i915/chv: Ack interrupts before handling them (CHV)
Date: Mon, 16 Jun 2014 12:30:29 +0100	[thread overview]
Message-ID: <1402918229-7246-4-git-send-email-oscar.mateo@intel.com> (raw)
In-Reply-To: <1402918229-7246-1-git-send-email-oscar.mateo@intel.com>

From: Oscar Mateo <oscar.mateo@intel.com>

Otherwise, we might receive a new interrupt before we have time to
ack the first one, eventually missing it.

Notice that, before clearing a port-sourced interrupt in the IIR, the
corresponding interrupt source status in the PORT_HOTPLUG_STAT must be
cleared.

Spotted by Bob Beckett <robert.beckett@intel.com>.

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 59ff177..98009b5 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1895,21 +1895,22 @@ static irqreturn_t cherryview_irq_handler(int irq, void *arg)
 		if (master_ctl == 0 && iir == 0)
 			break;
 
-		I915_WRITE(GEN8_MASTER_IRQ, 0);
-
-		gen8_gt_irq_handler(dev, dev_priv, master_ctl);
+		ret = IRQ_HANDLED;
 
-		valleyview_pipestat_irq_handler(dev, iir);
+		I915_WRITE(GEN8_MASTER_IRQ, 0);
 
-		/* Consume port.  Then clear IIR or we'll miss events */
-		i9xx_hpd_irq_handler(dev);
+		if (iir) {
+			/* Consume port. Then clear IIR or we'll miss events */
+			if (iir & I915_DISPLAY_PORT_INTERRUPT)
+				i9xx_hpd_irq_handler(dev);
+			I915_WRITE(VLV_IIR, iir);
+			valleyview_pipestat_irq_handler(dev, iir);
+		}
 
-		I915_WRITE(VLV_IIR, iir);
+		gen8_gt_irq_handler(dev, dev_priv, master_ctl);
 
 		I915_WRITE(GEN8_MASTER_IRQ, DE_MASTER_IRQ_CONTROL);
 		POSTING_READ(GEN8_MASTER_IRQ);
-
-		ret = IRQ_HANDLED;
 	}
 
 	return ret;
-- 
1.9.0

  parent reply	other threads:[~2014-06-16 11:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 11:30 [PATCH 1/4] drm/i915: Ack interrupts before handling them (GEN5 - GEN7) oscar.mateo
2014-06-16 11:30 ` [PATCH 2/4] drm/i915/vlv: Ack interrupts before handling them (VLV) oscar.mateo
2014-06-16 13:05   ` Ville Syrjälä
2014-06-16 13:19   ` Imre Deak
2014-06-16 18:07     ` Daniel Vetter
2014-06-17  8:29       ` Mateo Lozano, Oscar
2014-06-16 11:30 ` [PATCH 3/4] drm/i915/bdw: Ack interrupts before handling them (GEN8) oscar.mateo
2014-06-16 11:30 ` oscar.mateo [this message]
2014-06-16 12:07 ` [PATCH 1/4] drm/i915: Ack interrupts before handling them (GEN5 - GEN7) Chris Wilson
2014-06-16 18:10   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402918229-7246-4-git-send-email-oscar.mateo@intel.com \
    --to=oscar.mateo@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox