Skip to contentSkip to conversation

Dynamic parity detection

RFC PATCH Superseded Ben Widawsky 2 participants 6 messages Apr 13, 2012 – Apr 14, 2012

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Dynamic parity detection

I'm still working on the test cases for this feature. I just wanted to put these patches out there to make sure people were okay with the concept.

I think it's pretty straightforward... uevent on error, and binary sysfs interface to remap the bad rows.

If nobody has any issue with the "design" I'll repost the series when I've tested this on specially modified hardware.

Ben Widawsky (2):
drm/i915: Dynamic Parity Detection handling
drm/i915: l3 parity sysfs interface

 drivers/gpu/drm/i915/i915_drv.h         |    2 +
 drivers/gpu/drm/i915/i915_irq.c         |   65 ++++++++++++++++++-
 drivers/gpu/drm/i915/i915_reg.h         |   26 ++++++++
 drivers/gpu/drm/i915/i915_sysfs.c       |  103 ++++++++++++++++++++++++++++++-
 drivers/gpu/drm/i915/intel_ringbuffer.c |    6 +-
 5 files changed, 197 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.10
#1 lore raw

PATCH 1/2 drm/i915: Dynamic Parity Detection handling

On IVB hardware we are given an interrupt whenever a parity error occurs in the L3 cache. This is a very rare occurrence (in fact to test this I need to use specially instrumented silicon).

When a row in the L3 cache detects a parity error, we alert userspace via a uevent. With this information userspace can use a sysfs interface (follow-up patch) to remap those row. Based on the fabrication process, and random events like gamma rays, certain rows *can* be more susceptible.

---
 drivers/gpu/drm/i915/i915_drv.h         |    2 +
 drivers/gpu/drm/i915/i915_irq.c         |   65 ++++++++++++++++++++++++++++++-
 drivers/gpu/drm/i915/i915_reg.h         |   16 ++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c |    6 ++-
 4 files changed, 86 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index 422f424..8f31e0f 100644
@@ -805,6 +805,8 @@ typedef struct drm_i915_private {
 
 	struct drm_property *broadcast_rgb_property;
 	struct drm_property *force_audio_property;
+
+	struct work_struct parity_error_work;
 } drm_i915_private_t;
 
 enum hdmi_force_audio {
drivers/gpu/drm/i915/i915_irq.c +64 -1

89 lines not on this page · raw message

drivers/gpu/drm/i915/i915_reg.h +16 -0
index 972321f..de1685e 100644
@@ -3991,6 +3991,22 @@
 #define   GEN6_RC6			3
 #define   GEN6_RC7			4
 
+#define GEN7_MISCCPCTL			(0x9424)
+#define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
+
+/* IVYBRIDGE DPF */
+#define GEN7_L3CDERRST1			0xB008 /* L3CD Error Status 1 */
+#define   GEN7_L3CDERRST1_ROW_MASK	(0x7ff<<14)
+#define   GEN7_PARITY_ERROR_VALID	(1<<13)
+#define   GEN7_L3CDERRST1_BANK_MASK	(3<<11)
+#define   GEN7_L3CDERRST1_SUBBANK_MASK	(7<<8)
+#define GEN7_PARITY_ERROR_ROW(reg) \
+		((reg & GEN7_L3CDERRST1_ROW_MASK) >> 14)
+#define GEN7_PARITY_ERROR_BANK(reg) \
+		((reg & GEN7_L3CDERRST1_BANK_MASK) >> 11)
+#define GEN7_PARITY_ERROR_SUBBANK(reg) \
+		((reg & GEN7_L3CDERRST1_SUBBANK_MASK) >> 8)
+
 #define G4X_AUD_VID_DID			0x62020
 #define INTEL_AUDIO_DEVCL		0x808629FB
 #define INTEL_AUDIO_DEVBLC		0x80862801
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -2
index 467b331..f956741 100644
@@ -1446,7 +1446,8 @@ int intel_init_render_ring_buffer(struct drm_device *dev)
 		ring->flush = gen6_render_ring_flush;
 		ring->irq_get = gen6_ring_get_irq;
 		ring->irq_put = gen6_ring_put_irq;
-		ring->irq_enable = GT_USER_INTERRUPT;
+		ring->irq_enable = GT_USER_INTERRUPT |
+				   GT_GEN7_L3_PARITY_ERROR_INTERRUPT;
 		ring->get_seqno = gen6_ring_get_seqno;
 	} else if (IS_GEN5(dev)) {
 		ring->add_request = pc_render_add_request;
@@ -1471,7 +1472,8 @@ int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size)
 		ring->add_request = gen6_add_request;
 		ring->irq_get = gen6_ring_get_irq;
 		ring->irq_put = gen6_ring_put_irq;
-		ring->irq_enable = GT_USER_INTERRUPT;
+		ring->irq_enable = GT_USER_INTERRUPT |
+				   GT_GEN7_L3_PARITY_ERROR_INTERRUPT;
 	} else if (IS_GEN5(dev)) {
 		ring->add_request = pc_render_add_request;
 		ring->get_seqno = pc_render_get_seqno;
Signature · 1 line
1.7.10
#2 lore raw

PATCH 2/2 drm/i915: l3 parity sysfs interface

In reply to Ben Widawsky

Dumb binary interfaces which allow root-only updates of our cache remapping registers. See intel-gpu-tools for how this can/should be used.

---
 drivers/gpu/drm/i915/i915_reg.h   |   10 ++++
 drivers/gpu/drm/i915/i915_sysfs.c |  103 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 111 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +10 -0
index de1685e..1a93395 100644
@@ -4007,6 +4007,16 @@
 #define GEN7_PARITY_ERROR_SUBBANK(reg) \
 		((reg & GEN7_L3CDERRST1_SUBBANK_MASK) >> 8)
 
+#define GEN7_L3LOG_BASE				0xB070
+#define GEN7_L3LOG_SIZE				0x80
+#if 0
+#define   GEN7_L3LOG_ROW1(reg)         ((reg>>21) & IVYBRDIGE_L3_ROW_MASK)
+#define   GEN7_L3LOG_VLDERR1           (1<<16)
+#define   GEN7_L3LOG_ROW0(reg)         ((reg>>5) & IVYBRDIGE_L3_ROW_MASK)
+#define   GEN7_L3LOG_VLDERR0           (1<<0)
+#endif
+
+
 #define G4X_AUD_VID_DID			0x62020
 #define INTEL_AUDIO_DEVCL		0x808629FB
 #define INTEL_AUDIO_DEVBLC		0x80862801
drivers/gpu/drm/i915/i915_sysfs.c +101 -2

121 lines not on this page · raw message

Signature · 1 line
1.7.10
#3 lore raw

Re: [PATCH 2/2] drm/i915: l3 parity sysfs interface

Quoted 3 lines · Ben Widawsky

Dumb binary interfaces which allow root-only updates of our cache remapping registers. See intel-gpu-tools for how this can/should be used.

Initial comments: don't bother posting a read just before a read, and do return errors from the sysfs read/write functions (the return value is signed for that purpose). A lesser issue is that if you are worried about necessity of posting-reads, you should also worry about the effect of the weak ordering of writes.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#4 lore raw

Re: [PATCH 2/2] drm/i915: l3 parity sysfs interface

Quoted 6 lines · On Sat, 14 Apr 2012 00:24:03 +0100 Chris Wilson <[email protected]>…
Quoted 3 lines · Ben Widawsky

Dumb binary interfaces which allow root-only updates of our cache remapping registers. See intel-gpu-tools for how this can/should be used.

Quoted 7 lines

Initial comments: don't bother posting a read just before a read, and do return errors from the sysfs read/write functions (the return value is signed for that purpose). A lesser issue is that if you are worried about necessity of posting-reads, you should also worry about the effect of the weak ordering of writes.
-Chris

Thanks for the advice on the sysfs return values. Some of the code I was referring from just returns 0, but this seems to be not the right thing to do after looking further into it.

As for the POSTING_READ it was intentional. Unless reads are always in order??? I have to make sure the clock gating disable propogates before I can read the L3 registers.

Ben

#5 lore raw

Re: [PATCH 2/2] drm/i915: l3 parity sysfs interface

Quoted 17 lines · On Fri, 13 Apr 2012 18:39:24 -0700 Ben Widawsky <[email protected]> wrote:
Quoted 6 lines · On Sat, 14 Apr 2012 00:24:03 +0100 Chris Wilson <[email protected]>…
Quoted 3 lines · Ben Widawsky

Dumb binary interfaces which allow root-only updates of our cache remapping registers. See intel-gpu-tools for how this can/should be used.

Quoted 7 lines

Initial comments: don't bother posting a read just before a read, and do return errors from the sysfs read/write functions (the return value is signed for that purpose). A lesser issue is that if you are worried about necessity of posting-reads, you should also worry about the effect of the weak ordering of writes.
-Chris

Quoted 8 lines

Thanks for the advice on the sysfs return values. Some of the code I was referring from just returns 0, but this seems to be not the right thing to do after looking further into it.

As for the POSTING_READ it was intentional. Unless reads are always in order??? I have to make sure the clock gating disable propogates before I can read the L3 registers.

On further thought, yeah - you are right.