All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/hsw: Implement Selective Write workaround
@ 2014-12-19  2:20 Ben Widawsky
  2014-12-19  8:20 ` [Intel-gfx] " Chris Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Widawsky @ 2014-12-19  2:20 UTC (permalink / raw)
  To: Intel GFX; +Cc: Ben Widawsky, Kenneth Graunke, stable

From: Ben Widawsky <ben@bwidawsk.net>

The docs specify this needs to be set on HSW GT1 parts. I've implemented it as
such since it should only be needed when using RC6, but it can probably go
anywhere.

This patch fixes extremely reproducible hangs on our Jenkins setup.

The interesting failure signature is:
  IPEHR: 0x780c0000 (3DSTATE_VF)
  INSTDONE_0: 0xffdfbffa (SVG + VS)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87138 (more?)
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: stable@vger.kernel.org
Reported-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_drv.h | 2 ++
 drivers/gpu/drm/i915/i915_reg.h | 7 +++++++
 drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++
 3 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 921e4c5..f69984d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2282,6 +2282,8 @@ struct drm_i915_cmd_table {
 				 (INTEL_DEVID(dev) & 0xf) == 0xe))
 #define IS_BDW_GT3(dev)		(IS_BROADWELL(dev) && \
 				 (INTEL_DEVID(dev) & 0x00F0) == 0x0020)
+#define IS_HSW_GT1(dev)		(IS_HASWELL(dev) && \
+				 (INTEL_DEVID(dev) & 0x00F0) == 0x0)
 #define IS_HSW_ULT(dev)		(IS_HASWELL(dev) && \
 				 (INTEL_DEVID(dev) & 0xFF00) == 0x0A00)
 #define IS_HSW_GT3(dev)		(IS_HASWELL(dev) && \
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 40ca873..f9ff662 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -1218,6 +1218,13 @@ enum punit_power_well {
 #define RING_DMA_FADD_UDW(base)	((base)+0x60) /* gen8+ */
 #define RING_INSTPM(base)	((base)+0xc0)
 #define RING_MI_MODE(base)	((base)+0x9c)
+#define RING_WAIT_FOR_RC6_EXIT(base)	((base)+0xcc)
+#define   RING_RC6_SEL_WRITE_ADDR_MASK		(0x7 << 4)
+#define   RING_RC6_SEL_WRITE_ADDR_MULTICAST	(0x0 << 4)
+#define   RING_RC6_SEL_WRITE_ADDR_UPPER_LEFT	(0x4 << 4)
+#define   RING_RC6_SEL_WRITE_ADDR_UPPER_RIGHT	(0x5 << 4)
+#define   RING_RC6_SEL_WRITE_ADDR_LOWER_LEFT	(0x6 << 4)
+#define   RING_RC6_SEL_WRITE_ADDR_LOWER_RIGHT	(0x7 << 4)
 #define INSTPS		0x02070 /* 965+ only */
 #define INSTDONE1	0x0207c /* 965+ only */
 #define ACTHD_I965	0x02074
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index a3ebaa8..a27003c 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4259,6 +4259,15 @@ static void gen6_enable_rps(struct drm_device *dev)
 			DRM_ERROR("Couldn't fix incorrect rc6 voltage\n");
 	}
 
+	/* HSW GT1: "This field must be always [be] programmed to “100” , this
+	 * is required to address know [sic] HW issue." */
+	if (IS_HSW_GT1(dev)) {
+		for_each_ring(ring, dev_priv, i) {
+			I915_WRITE(RING_WAIT_FOR_RC6_EXIT(ring->mmio_base),
+				   _MASKED_FIELD(RING_RC6_SEL_WRITE_ADDR_MASK,
+						 RING_RC6_SEL_WRITE_ADDR_UPPER_LEFT));
+		}
+	}
 	gen6_gt_force_wake_put(dev_priv, FORCEWAKE_ALL);
 }
 
-- 
2.2.0

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

* Re: [Intel-gfx] [PATCH] drm/i915/hsw: Implement Selective Write workaround
  2014-12-19  2:20 [PATCH] drm/i915/hsw: Implement Selective Write workaround Ben Widawsky
@ 2014-12-19  8:20 ` Chris Wilson
  2014-12-19 17:26   ` Ben Widawsky
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2014-12-19  8:20 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: Intel GFX, Ben Widawsky, stable

On Thu, Dec 18, 2014 at 06:20:18PM -0800, Ben Widawsky wrote:
> From: Ben Widawsky <ben@bwidawsk.net>
> 
> The docs specify this needs to be set on HSW GT1 parts. I've implemented it as
> such since it should only be needed when using RC6, but it can probably go
> anywhere.
> 
> This patch fixes extremely reproducible hangs on our Jenkins setup.
> 
> The interesting failure signature is:
>   IPEHR: 0x780c0000 (3DSTATE_VF)
>   INSTDONE_0: 0xffdfbffa (SVG + VS)

We see the same bug on IVB, and the bug (verified on hsw gt1) persists with i915.enable_rc6=0.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* Re: [PATCH] drm/i915/hsw: Implement Selective Write workaround
  2014-12-19  8:20 ` [Intel-gfx] " Chris Wilson
@ 2014-12-19 17:26   ` Ben Widawsky
  2014-12-19 18:34     ` [Intel-gfx] " Chris Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Widawsky @ 2014-12-19 17:26 UTC (permalink / raw)
  To: Chris Wilson, Ben Widawsky, Intel GFX, stable

On Fri, Dec 19, 2014 at 08:20:04AM +0000, Chris Wilson wrote:
> On Thu, Dec 18, 2014 at 06:20:18PM -0800, Ben Widawsky wrote:
> > From: Ben Widawsky <ben@bwidawsk.net>
> > 
> > The docs specify this needs to be set on HSW GT1 parts. I've implemented it as
> > such since it should only be needed when using RC6, but it can probably go
> > anywhere.
> > 
> > This patch fixes extremely reproducible hangs on our Jenkins setup.
> > 
> > The interesting failure signature is:
> >   IPEHR: 0x780c0000 (3DSTATE_VF)
> >   INSTDONE_0: 0xffdfbffa (SVG + VS)
> 
> We see the same bug on IVB, and the bug (verified on hsw gt1) persists with i915.enable_rc6=0.
> -Chris

I would claim it's not the same bug on IVB. The workaround very specifically
says HSW GT1 only. The failure signature itself is pretty generic, it just
suggests the VS went off and did something stupid, and the VF was unable to fill
the URB. (That's just my best guess) I do apologize if I inadvertently made a
connection to the IVB bug issue.

So, what is your point? I'm willing to concede we don't know all the facts, but
the [previous version of this] patch demonstrably fixes hangs on HSW GT1.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH] drm/i915/hsw: Implement Selective Write workaround
  2014-12-19 17:26   ` Ben Widawsky
@ 2014-12-19 18:34     ` Chris Wilson
  2014-12-19 20:05       ` Chris Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2014-12-19 18:34 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: Ben Widawsky, Intel GFX, stable

On Fri, Dec 19, 2014 at 09:26:01AM -0800, Ben Widawsky wrote:
> On Fri, Dec 19, 2014 at 08:20:04AM +0000, Chris Wilson wrote:
> > On Thu, Dec 18, 2014 at 06:20:18PM -0800, Ben Widawsky wrote:
> > > From: Ben Widawsky <ben@bwidawsk.net>
> > > 
> > > The docs specify this needs to be set on HSW GT1 parts. I've implemented it as
> > > such since it should only be needed when using RC6, but it can probably go
> > > anywhere.
> > > 
> > > This patch fixes extremely reproducible hangs on our Jenkins setup.
> > > 
> > > The interesting failure signature is:
> > >   IPEHR: 0x780c0000 (3DSTATE_VF)
> > >   INSTDONE_0: 0xffdfbffa (SVG + VS)
> > 
> > We see the same bug on IVB, and the bug (verified on hsw gt1) persists with i915.enable_rc6=0.
> > -Chris
> 
> I would claim it's not the same bug on IVB. The workaround very specifically
> says HSW GT1 only. The failure signature itself is pretty generic, it just
> suggests the VS went off and did something stupid, and the VF was unable to fill
> the URB. (That's just my best guess) I do apologize if I inadvertently made a
> connection to the IVB bug issue.

The failure message matches the context hang bug: "dies on last
instruction in the context restore" and probably has nothing to do with
the VS.
 
> So, what is your point? I'm willing to concede we don't know all the facts, but
> the [previous version of this] patch demonstrably fixes hangs on HSW GT1.

Just a patch a few days ago that to fix a very ontologically similar bug
for ivb+.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* Re: [Intel-gfx] [PATCH] drm/i915/hsw: Implement Selective Write workaround
  2014-12-19 18:34     ` [Intel-gfx] " Chris Wilson
@ 2014-12-19 20:05       ` Chris Wilson
  2014-12-19 22:14         ` Ben Widawsky
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2014-12-19 20:05 UTC (permalink / raw)
  To: Ben Widawsky, Ben Widawsky, Intel GFX, stable

On Fri, Dec 19, 2014 at 06:34:07PM +0000, Chris Wilson wrote:
> Just a patch a few days ago that to fix a very ontologically similar bug
> for ivb+.

Oh boy. I just double checked the error states from those bugs I marked
as ivb context restore hangs... So far I appear to have consistently
mislabled 0x402/0x406 as ivb and not hsw gt1. /o\
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* Re: [PATCH] drm/i915/hsw: Implement Selective Write workaround
  2014-12-19 20:05       ` Chris Wilson
@ 2014-12-19 22:14         ` Ben Widawsky
  2015-01-05 10:02           ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Widawsky @ 2014-12-19 22:14 UTC (permalink / raw)
  To: Chris Wilson, Ben Widawsky, Intel GFX, stable

On Fri, Dec 19, 2014 at 08:05:30PM +0000, Chris Wilson wrote:
> On Fri, Dec 19, 2014 at 06:34:07PM +0000, Chris Wilson wrote:
> > Just a patch a few days ago that to fix a very ontologically similar bug
> > for ivb+.
> 
> Oh boy. I just double checked the error states from those bugs I marked
> as ivb context restore hangs... So far I appear to have consistently
> mislabled 0x402/0x406 as ivb and not hsw gt1. /o\
> -Chris

I don't know what to do with this patch now. It looks like all we needed was
your patch. Merge without the "stable" is what I'm thinking.

> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/hsw: Implement Selective Write workaround
  2014-12-19 22:14         ` Ben Widawsky
@ 2015-01-05 10:02           ` Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2015-01-05 10:02 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: Intel GFX, Ben Widawsky, stable

On Fri, Dec 19, 2014 at 02:14:31PM -0800, Ben Widawsky wrote:
> On Fri, Dec 19, 2014 at 08:05:30PM +0000, Chris Wilson wrote:
> > On Fri, Dec 19, 2014 at 06:34:07PM +0000, Chris Wilson wrote:
> > > Just a patch a few days ago that to fix a very ontologically similar bug
> > > for ivb+.
> > 
> > Oh boy. I just double checked the error states from those bugs I marked
> > as ivb context restore hangs... So far I appear to have consistently
> > mislabled 0x402/0x406 as ivb and not hsw gt1. /o\
> > -Chris
> 
> I don't know what to do with this patch now. It looks like all we needed was
> your patch. Merge without the "stable" is what I'm thinking.

Makes sense if we really don't need it any more with Chris' patches in
-fixes. Can you please volunteer someone to cough up an r-b?

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-01-05 10:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-19  2:20 [PATCH] drm/i915/hsw: Implement Selective Write workaround Ben Widawsky
2014-12-19  8:20 ` [Intel-gfx] " Chris Wilson
2014-12-19 17:26   ` Ben Widawsky
2014-12-19 18:34     ` [Intel-gfx] " Chris Wilson
2014-12-19 20:05       ` Chris Wilson
2014-12-19 22:14         ` Ben Widawsky
2015-01-05 10:02           ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.