Skip to contentSkip to conversation

Ivybridge hang fixes respun

PATCH In review Kenneth Graunke 4 participants 8 messages Feb 8, 2012 – Feb 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

These fix many GPU hangs for Eugeni, though not on my machine for some reason.

Oddly, the register writes to UCGCTL2 and SQ_CHICKEN_MBCUNIT_CONFIG stick, but the writes to L3_CHICKEN_MODE, L3CNTLREG1, and COMMON_SLICE_CHICKEN1 don't seem to take effect. Currently no theories why.

Manually writing these values with intel_reg_write /does/ fix the hangs for me.

I'm fine with these going to -fixes. They seem to help some people, and I highly doubt they'll make anything worse. It'd be nice to understand why the register writes aren't sticking, though...

#1 lore raw

PATCH 1/4 drm/i915: gen7: implement rczunit workaround

From: Eugeni Dodonov <[email protected]>

This is yet another workaround related to clock gating which we need on Ivy Bridge.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41353
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44610

---
 drivers/gpu/drm/i915/i915_reg.h      |    1 +
 drivers/gpu/drm/i915/intel_display.c |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index c3afb78..80fd6b5 100644
@@ -3618,6 +3618,7 @@
 #define    GT_FIFO_NUM_RESERVED_ENTRIES		20
 
 #define GEN6_UCGCTL2				0x9404
+# define GEN6_RCZUNIT_CLOCK_GATE_DISABLE		(1 << 13)
 # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE		(1 << 12)
 # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE		(1 << 11)
 
drivers/gpu/drm/i915/intel_display.c +5 -0
index f1744aa..070c946 100644
@@ -8461,6 +8461,11 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
+	/* According to the spec, bit 13 (RCZUNIT) must be set on IVB.
+	 * This implements the WaDisableRCZUnitClockGating workaround.
+	 */
+	I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
+
 	I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);
 
 	I915_WRITE(IVB_CHICKEN3,
Signature · 1 line
1.7.7.1
#2 lore raw

Re: [PATCH 1/4] drm/i915: gen7: implement rczunit workaround

Quoted 11 lines · On Wed, 8 Feb 2012 12:53:49 -0800 Kenneth Graunke <[email protected]>…

From: Eugeni Dodonov <[email protected]>

This is yet another workaround related to clock gating which we need on Ivy Bridge.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41353
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44610

---

Ok thanks guys, I've pushed this to my drm-intel-fixes branch in
git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/drm-intel.git.

Please shout if anything goes wrong.

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

PATCH 2/4 drm/i915: gen7: Implement an L3 caching workaround.

In reply to Kenneth Graunke

From: Eugeni Dodonov <[email protected]>

This adds two cache-related workarounds for Ivy Bridge which can lead to 3D ring hangs and corruptions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41353
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44610

---
 drivers/gpu/drm/i915/i915_reg.h      |    7 +++++++
 drivers/gpu/drm/i915/intel_display.c |    6 ++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +7 -0
index 80fd6b5..ca4737e 100644
@@ -3028,6 +3028,13 @@
 #define  DISP_TILE_SURFACE_SWIZZLING	(1<<13)
 #define  DISP_FBC_WM_DIS		(1<<15)
 
+/* GEN7 chicken */
+#define GEN7_L3CNTLREG1				0xB01C
+#define  GEN7_WA_FOR_GEN7_L3_CONTROL			0x3C4FFF8C
+
+#define GEN7_L3_CHICKEN_MODE_REGISTER		0xB030
+#define  GEN7_WA_L3_CHICKEN_MODE				0x20000000
+
 /* PCH */
 
 /* south display engine interrupt */
drivers/gpu/drm/i915/intel_display.c +6 -0
index 070c946..2db1b67 100644
@@ -8472,6 +8472,12 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 		   CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
 		   CHICKEN3_DGMG_DONE_FIX_DISABLE);
 
+	/* WaApplyL3ControlAndL3ChickenMode requires those two on Ivy Bridge */
+	I915_WRITE(GEN7_L3CNTLREG1,
+			GEN7_WA_FOR_GEN7_L3_CONTROL);
+	I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
+			GEN7_WA_L3_CHICKEN_MODE);
+
 	for_each_pipe(pipe) {
 		I915_WRITE(DSPCNTR(pipe),
 			   I915_READ(DSPCNTR(pipe)) |
Signature · 1 line
1.7.7.1
#4 lore raw

PATCH 3/4 drm/i915: gen7: work around a system hang on IVB

In reply to Kenneth Graunke

From: Eugeni Dodonov <[email protected]>

This adds the workaround for WaCatErrorRejectionIssue which could result in a system hang.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41353
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44610

---
 drivers/gpu/drm/i915/i915_reg.h      |    4 ++++
 drivers/gpu/drm/i915/intel_display.c |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +4 -0
index ca4737e..4e1ee90 100644
@@ -3035,6 +3035,10 @@
 #define GEN7_L3_CHICKEN_MODE_REGISTER		0xB030
 #define  GEN7_WA_L3_CHICKEN_MODE				0x20000000
 
+/* WaCatErrorRejectionIssue */
+#define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		0x9030
+#define  GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB	(1<<11)
+
 /* PCH */
 
 /* south display engine interrupt */
drivers/gpu/drm/i915/intel_display.c +5 -0
index 2db1b67..8b5ee4b 100644
@@ -8478,6 +8478,11 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
 			GEN7_WA_L3_CHICKEN_MODE);
 
+	/* This is required by WaCatErrorRejectionIssue */
+	I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
+			I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
+			GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
+
 	for_each_pipe(pipe) {
 		I915_WRITE(DSPCNTR(pipe),
 			   I915_READ(DSPCNTR(pipe)) |
Signature · 1 line
1.7.7.1
#5 lore raw

PATCH 4/4 drm/i915: gen7: Disable the RHWO optimization as it can cause GPU hangs.

In reply to Kenneth Graunke

The BSpec Workarounds page states that bits 10 and 26 must be set to avoid 3D ring hangs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41353
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44610

---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 4e1ee90..03c53fc 100644
@@ -3029,6 +3029,9 @@
 #define  DISP_FBC_WM_DIS		(1<<15)
 
 /* GEN7 chicken */
+#define GEN7_COMMON_SLICE_CHICKEN1		0x7010
+# define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
+
 #define GEN7_L3CNTLREG1				0xB01C
 #define  GEN7_WA_FOR_GEN7_L3_CONTROL			0x3C4FFF8C
 
drivers/gpu/drm/i915/intel_display.c +4 -0
index 8b5ee4b..57a606d 100644
@@ -8472,6 +8472,10 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 		   CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
 		   CHICKEN3_DGMG_DONE_FIX_DISABLE);
 
+	/* Apply the WaDisableRHWOOptimizationForRenderHang workaround. */
+	I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
+		   GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
+
 	/* WaApplyL3ControlAndL3ChickenMode requires those two on Ivy Bridge */
 	I915_WRITE(GEN7_L3CNTLREG1,
 			GEN7_WA_FOR_GEN7_L3_CONTROL);
Signature · 1 line
1.7.7.1
#6 lore raw
In reply to Kenneth Graunke
Quoted 7 lines · Kenneth Graunke

These fix many GPU hangs for Eugeni, though not on my machine for some reason.

Oddly, the register writes to UCGCTL2 and SQ_CHICKEN_MBCUNIT_CONFIG stick, but the writes to L3_CHICKEN_MODE, L3CNTLREG1, and COMMON_SLICE_CHICKEN1 don't seem to take effect. Currently no theories why.

Quoted 7 lines

Manually writing these values with intel_reg_write /does/ fix the hangs for me.

I'm fine with these going to -fixes. They seem to help some people, and I highly doubt they'll make anything worse. It'd be nice to understand why the register writes aren't sticking, though...

Complementing Ken's mail, Li Bo from our QA team has did a full round of tests with these patches on IVB and all known issues were gone apparently.

Keith, Jesse - I think they are good -fixes candidates at this point.

Signature · 2 lines
Eugeni Dodonov
<http://eugeni.dodonov.net/>

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

<#part sign=pgpmime>

Quoted 1 line · Eugeni Dodonov

Keith, Jesse - I think they are good -fixes candidates at this point.

I'll be sending a pull request today without these; please work with Jesse to get them merged after that.

Signature · 1 line
[email protected]