intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded
@ 2011-04-05 22:00 Chris Wilson
  2011-04-06  1:27 ` Keith Packard
  2011-05-04 19:21 ` Keith Packard
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Wilson @ 2011-04-05 22:00 UTC (permalink / raw)
  To: intel-gfx

This looks like it fixes two bugs:

1) What if there is an error recorded before we start and so we
immediately service an IIR/EIR upon intalling the IRQ. Did we generate
that error during initialisation or was that SEP? Now we do stuff before
we even install the IRQ so there is a possibility that we zap one of our
own.

2) When re-enabling the interrupt (gpu reset) we need to preserve any
masking of stuck EIR.

I guess this is easiest to test by generating an EIR, then reloading the
module? Does EIR even persist between phases to cause these issues in
the first place?

Something to think about...
---
 drivers/gpu/drm/i915/i915_irq.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 46ccfc8..bb1a624 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1650,11 +1650,24 @@ static int ironlake_irq_postinstall(struct drm_device *dev)
 	return 0;
 }
 
+static void i915_irq_clear_errors(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	u32 eir = I915_READ(EIR);
+	if (eir) {
+		I915_WRITE(EIR, eir);
+		POSTING_READ(EIR);
+	}
+}
+
 void i915_driver_irq_preinstall(struct drm_device * dev)
 {
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
 	int pipe;
 
+	/* Clear any errors recorded before we begin. */
+	i915_irq_clear_errors(dev);
+
 	atomic_set(&dev_priv->irq_received, 0);
 
 	INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
@@ -1719,7 +1732,8 @@ int i915_driver_irq_postinstall(struct drm_device *dev)
 		error_mask = ~(I915_ERROR_PAGE_TABLE |
 			       I915_ERROR_MEMORY_REFRESH);
 	}
-	I915_WRITE(EMR, error_mask);
+	/* Some pre-existing errors might have become stuck, mask them.  */
+	I915_WRITE(EMR, error_mask | I915_READ(EIR));
 
 	I915_WRITE(IMR, dev_priv->irq_mask);
 	I915_WRITE(IER, enable_mask);
-- 
1.7.4.1

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

* Re: [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded
  2011-04-05 22:00 [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded Chris Wilson
@ 2011-04-06  1:27 ` Keith Packard
  2011-04-06  6:52   ` Chris Wilson
  2011-05-04 19:21 ` Keith Packard
  1 sibling, 1 reply; 6+ messages in thread
From: Keith Packard @ 2011-04-06  1:27 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 696 bytes --]

On Tue,  5 Apr 2011 23:00:46 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> This looks like it fixes two bugs:
> 
> 1) What if there is an error recorded before we start and so we
> immediately service an IIR/EIR upon intalling the IRQ. Did we generate
> that error during initialisation or was that SEP? Now we do stuff before
> we even install the IRQ so there is a possibility that we zap one of our
> own.

How will processing a pre-existing error condition cause trouble?

> Does EIR even persist between phases to cause these issues in the
> first place?

Yeah, seems like a bit of testing might be able to check this fairly quickly.

-- 
keith.packard@intel.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded
  2011-04-06  1:27 ` Keith Packard
@ 2011-04-06  6:52   ` Chris Wilson
  2011-04-07  3:55     ` Keith Packard
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2011-04-06  6:52 UTC (permalink / raw)
  To: Keith Packard, intel-gfx

On Tue, 05 Apr 2011 18:27:45 -0700, Keith Packard <keithp@keithp.com> wrote:
> On Tue,  5 Apr 2011 23:00:46 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > This looks like it fixes two bugs:
> > 
> > 1) What if there is an error recorded before we start and so we
> > immediately service an IIR/EIR upon intalling the IRQ. Did we generate
> > that error during initialisation or was that SEP? Now we do stuff before
> > we even install the IRQ so there is a possibility that we zap one of our
> > own.
> 
> How will processing a pre-existing error condition cause trouble?

So that I can separate out bug reports that are caused by us during
initialisation from those that are caused by whatever was running before
us.

Considering the difficulty in working out what caused a PGTBL_ER during
initialisation, any reduction in the volume of noise is a good thing.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* Re: [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded
  2011-04-06  6:52   ` Chris Wilson
@ 2011-04-07  3:55     ` Keith Packard
  0 siblings, 0 replies; 6+ messages in thread
From: Keith Packard @ 2011-04-07  3:55 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 559 bytes --]

On Wed, 06 Apr 2011 07:52:27 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:

> So that I can separate out bug reports that are caused by us during
> initialisation from those that are caused by whatever was running before
> us.

Ok, sounds like good -next material to me then.

> Considering the difficulty in working out what caused a PGTBL_ER during
> initialisation, any reduction in the volume of noise is a good thing.

Yeah, accurate error reports can go a long ways towards finding the real
trouble.

-- 
keith.packard@intel.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded
  2011-04-05 22:00 [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded Chris Wilson
  2011-04-06  1:27 ` Keith Packard
@ 2011-05-04 19:21 ` Keith Packard
  2011-05-04 19:32   ` Chris Wilson
  1 sibling, 1 reply; 6+ messages in thread
From: Keith Packard @ 2011-05-04 19:21 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 172 bytes --]

On Tue,  5 Apr 2011 23:00:46 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:

> Something to think about...

Missing SoB here...

-- 
keith.packard@intel.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded
  2011-05-04 19:21 ` Keith Packard
@ 2011-05-04 19:32   ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2011-05-04 19:32 UTC (permalink / raw)
  To: Keith Packard, intel-gfx

On Wed, 04 May 2011 12:21:27 -0700, Keith Packard <keithp@keithp.com> wrote:
> On Tue,  5 Apr 2011 23:00:46 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> > Something to think about...
> 
> Missing SoB here...

Indeed, I'm still thinking about this one. I don't think it's ready yet.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

end of thread, other threads:[~2011-05-04 19:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-05 22:00 [PATCH] drm/i915: Clear any errors recorded before i915.ko is loaded Chris Wilson
2011-04-06  1:27 ` Keith Packard
2011-04-06  6:52   ` Chris Wilson
2011-04-07  3:55     ` Keith Packard
2011-05-04 19:21 ` Keith Packard
2011-05-04 19:32   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).