drm/i915: gtfifodbg in error state
Subsystems (2)
PATCH 1/2 drm/i915: gtfifodbg in error state
- Add register definitions for GTFIFODBG.
- Capture it at error time.
- Print it from debugfs (with whitespace fix).
This register tells us if either a read, or a write occured while the fifo was full.
--- drivers/gpu/drm/i915/i915_debugfs.c | 3 ++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_irq.c | 1 + drivers/gpu/drm/i915/i915_reg.h | 6 ++++++ drivers/gpu/drm/i915/intel_display.c | 3 +++ 5 files changed, 13 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +2 -1
@@ -760,7 +760,8 @@ static int i915_error_state(struct seq_file *m, void *unused)seq_printf (m,"EIR: 0x%08x\n" , error->eir);seq_printf (m,"PGTBL_ER: 0x%08x\n" , error->pgtbl_er);if (INTEL_INFO (dev)->gen >=6 ) { -seq_printf (m,"ERROR: 0x%08x\n" , error->error); +seq_printf (m,"ERROR: 0x%08x\n" , error->error); +seq_printf (m,"FIFODBG: 0x%08x\n" , error->gtfifodbg);seq_printf (m,"Blitter command stream:\n" );seq_printf (m," ACTHD: 0x%08x\n" , error->bcs_acthd);seq_printf (m," IPEIR: 0x%08x\n" , error->bcs_ipeir);
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -173,6 +173,7 @@ struct drm_i915_error_state {u32 seqno;u64 bbaddr;u64 fence[I915_MAX_NUM_FENCES ]; +u32 gtfifodbg;struct timeval time;struct drm_i915_error_object {int page_count;
drivers/gpu/drm/i915/i915_irq.c +1 -0
@@ -918,6 +918,7 @@ static void i915_capture_error_state(struct drm_device *dev) error->error =0 ;if (INTEL_INFO (dev)->gen >=6 ) { error->error =I915_READ (ERROR_GEN6 ); + error->gtfifodbg =I915_READ (GTFIFODBG ); error->bcs_acthd =I915_READ (BCS_ACTHD ); error->bcs_ipehr =I915_READ (BCS_IPEHR );
drivers/gpu/drm/i915/i915_reg.h +6 -0
@@ -3614,6 +3614,12 @@#define ECOBUS 0xa180#define FORCEWAKE_MT_ENABLE (1<<5) +#define GTFIFODBG 0x120000 +#define GT_FIFO_OVFERR (1<<2) +#define GT_FIFO_CPU_ERROR_MASK 3 +#define GT_FIFO_IAWRERR (1<<1) +#define GT_FIFO_IARDERR (1<<0) +#define GT_FIFO_FREE_ENTRIES 0x120008#define GT_FIFO_NUM_RESERVED_ENTRIES 20
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -8215,6 +8215,9 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)*/ I915_WRITE (GEN6_RC_STATE ,0 );mutex_lock (&dev_priv->dev->struct_mutex); +/* Clear the DBG now so we don't confuse earlier errors */ +I915_WRITE (GTFIFODBG ,GT_FIFO_CPU_ERROR_MASK ); +gen6_gt_force_wake_get (dev_priv);/* disable the counters and set deterministic thresholds */
Signature · 1 line
1.7.9
PATCH 2/2 drm/i915: catch gtfifo errors on forcewake_put
This is similar to a patch I wrote several months ago. It's been updated for the new FORCEWAKE_MT, and it also no longer clears the debug register as it may be helpful to get that for the error state. Also recommended by Chris Wilson, use WARN() instead of DRM_ERROR, so we can get a backtrace.
--- drivers/gpu/drm/i915/i915_drv.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +6 -0
@@ -381,12 +381,18 @@ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)void __gen6_gt_force_wake_put (struct drm_i915_private *dev_priv) { +u32 gtfifodbg =I915_READ (GTFIFODBG ); +WARN (gtfifodbg >_FIFO_CPU_ERROR_MASK , +"MMIO read or write has been dropped %x\n" , gtfifodbg);I915_WRITE_NOTRACE (FORCEWAKE ,0 );POSTING_READ (FORCEWAKE ); }void __gen6_gt_force_wake_mt_put (struct drm_i915_private *dev_priv) { +u32 gtfifodbg =I915_READ (GTFIFODBG ); +WARN (gtfifodbg >_FIFO_CPU_ERROR_MASK , +"MMIO read or write has been dropped %x\n" , gtfifodbg);I915_WRITE_NOTRACE (FORCEWAKE_MT , (1 <<16 ) |0 );POSTING_READ (FORCEWAKE_MT ); }
Signature · 1 line
1.7.9
Re: [PATCH 2/2] drm/i915: catch gtfifo errors on forcewake_put
Quoted 7 lines · Ben Widawsky
This is similar to a patch I wrote several months ago. It's been updated for the new
FORCEWAKE_MT, and it also no longer clears the debug register as it may be helpful to get that for the error state. Also recommended by Chris Wilson, useWARN()instead ofDRM_ERROR, so we can get a backtrace.Signed-off-by Ben Widawsky <[email protected]>
Can we use the read of GTFIFODBG in place of the POSTING_READ? And do we really need to watch all the GTFIFODBG reads in the trace, or can I squelch that noise with a I915_READ_NOTRACE?
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Re: [PATCH 2/2] drm/i915: catch gtfifo errors on forcewake_put
Quoted 7 lines · Chris Wilson
Quoted 6 lines · Ben Widawsky
This is similar to a patch I wrote several months ago. It's been updated for the new
FORCEWAKE_MT, and it also no longer clears the debug register as it may be helpful to get that for the error state. Also recommended by Chris Wilson, useWARN()instead ofDRM_ERROR, so we can get a backtrace.
Quoted 6 lines
Quoted 1 line
Signed-off-by Ben Widawsky <[email protected]>Can we use the read of GTFIFODBG in place of the
POSTING_READ? And do we really need to watch all the GTFIFODBG reads in the trace, or can I squelch that noise with aI915_READ_NOTRACE?
-Chris
TBH, I don't really understand POSTING_READ that well. If it just requires that any read request made it through to the MCH (or whatever), then sure I can replace the POSTING_READ. Obviously though this is reading GTFIFODBG, and not FORCEWAKE, so you tell me.
As for READ_NOTRACE, I'm all for that. I'll wait to reroll the patch until you respond to the above though.
Re: [PATCH 2/2] drm/i915: catch gtfifo errors on forcewake_put
Quoted 6 lines · Ben Widawsky
Quoted 1 line · Chris Wilson
On Fri, 3 Feb 2012 14:31:41 -0800, Ben Widawsky <[email protected]> wrote:
TBH, I don't really understand
POSTING_READthat well. If it just requires that any read request made it through to the MCH (or whatever), then sure I can replace thePOSTING_READ. Obviously though this is reading GTFIFODBG, and not FORCEWAKE, so you tell me.
The posting read is simply a PCI write/read ordering barrier. It can be a read of any mmio address and before it is performed all previous writes to mmio addresses must have been sent along the PCI and no subsequent write is allowed to emitted ahead of the read. Hmm, so since the writes are in fact weakly ordered (they are allowed to be emitted in any order so long as they not reordered past a read), we would strictly need a barrier in front of the write to disable forcewake if it were not for the buffering performed by the chip of mmio writes under rc6.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 8 lines · Ben Widawsky
- Add register definitions for GTFIFODBG.
- Capture it at error time.
- Print it from debugfs (with whitespace fix).This register tells us if either a read, or a write occured while the fifo was full.
Signed-off-by Ben Widawsky <[email protected]>
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 7 lines · Ben Widawsky
- Add register definitions for GTFIFODBG.
- Capture it at error time.
- Print it from debugfs (with whitespace fix).This register tells us if either a read, or a write occured while the fifo was full.
Signature · 2 lines
Eugeni Dodonov <http://eugeni.dodonov.net/>
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/2 drm/i915: catch gtfifo errors on forcewake_put
In reply to Ben WidawskyThis is similar to a patch I wrote several months ago. It's been updated for the new FORCEWAKE_MT, and it also no longer clears the debug register as it may be helpful to get that for the error state. Also recommended by Chris Wilson, use WARN() instead of DRM_ERROR, so we can get a backtrace.
v2: replace POSTING_READ with I915_READ_NOTRACE(GTFIFODBG). Recommended by Chris Wilson
--- drivers/gpu/drm/i915/i915_drv.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +14 -2
@@ -381,14 +381,26 @@ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)void __gen6_gt_force_wake_put (struct drm_i915_private *dev_priv) { +u32 gtfifodbg; +I915_WRITE_NOTRACE (FORCEWAKE ,0 ); -POSTING_READ (FORCEWAKE ); + +/* The below doubles as a POSTING_READ */ + gtfifodbg =I915_READ_NOTRACE (GTFIFODBG ); +WARN (gtfifodbg >_FIFO_CPU_ERROR_MASK , +"MMIO read or write has been dropped %x\n" , gtfifodbg); }void __gen6_gt_force_wake_mt_put (struct drm_i915_private *dev_priv) { +u32 gtfifodbg; +I915_WRITE_NOTRACE (FORCEWAKE_MT , (1 <<16 ) |0 ); -POSTING_READ (FORCEWAKE_MT ); + +/* The below doubles as a POSTING_READ */ + gtfifodbg =I915_READ_NOTRACE (GTFIFODBG ); +WARN (gtfifodbg >_FIFO_CPU_ERROR_MASK , +"MMIO read or write has been dropped %x\n" , gtfifodbg); }/*
Signature · 1 line
1.7.9
Re: [PATCH 2/2 v2] drm/i915: catch gtfifo errors on forcewake_put
Quoted 11 lines · Ben Widawsky
This is similar to a patch I wrote several months ago. It's been updated for the new
FORCEWAKE_MT, and it also no longer clears the debug register as it may be helpful to get that for the error state. Also recommended by Chris Wilson, useWARN()instead ofDRM_ERROR, so we can get a backtrace.v2: replace
POSTING_READwithI915_READ_NOTRACE(GTFIFODBG). Recommended by Chris WilsonCc Chris Wilson <[email protected]>Signed-off-by Ben Widawsky <[email protected]>
Looks good and because we can drop the posting read it shouldn't have any perf impact. But we're not checking anything on the write side, which is actually used the most under normal gem loads (tail updates). Because the write path is rather perf critical, I think we should only check for errors in the gt fifo reg if the wait_for_fifo times out. Can you whip up that patch, too?
Thanks, Daniel
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Quoted 59 lines · Ben Widawsky
- Add register definitions for GTFIFODBG.
- Capture it at error time.
- Print it from debugfs (with whitespace fix).This register tells us if either a read, or a write occured while the fifo was full.
Signed-off-by Ben Widawsky <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 3 ++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_irq.c | 1 + drivers/gpu/drm/i915/i915_reg.h | 6 ++++++ drivers/gpu/drm/i915/intel_display.c | 3 +++ 5 files changed, 13 insertions(+), 1 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +2
-1@@ -760,7 +760,8 @@ static int i915_error_state(struct seq_file *m, void *unused)seq_printf (m,"EIR: 0x%08x\n" , error->eir);seq_printf (m,"PGTBL_ER: 0x%08x\n" , error->pgtbl_er);if (INTEL_INFO (dev)->gen >=6 ) { -seq_printf (m,"ERROR: 0x%08x\n" , error->error); +seq_printf (m,"ERROR: 0x%08x\n" , error->error); +seq_printf (m,"FIFODBG: 0x%08x\n" , error->gtfifodbg);seq_printf (m,"Blitter command stream:\n" );seq_printf (m," ACTHD: 0x%08x\n" , error->bcs_acthd);seq_printf (m," IPEIR: 0x%08x\n" , error->bcs_ipeir);drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -173,6 +173,7 @@ struct drm_i915_error_state {u32 seqno;u64 bbaddr;u64 fence[I915_MAX_NUM_FENCES ]; +u32 gtfifodbg;struct timeval time;struct drm_i915_error_object {int page_count;drivers/gpu/drm/i915/i915_irq.c +1
-0@@ -918,6 +918,7 @@ static void i915_capture_error_state(struct drm_device *dev) error->error =0 ;if (INTEL_INFO (dev)->gen >=6 ) { error->error =I915_READ (ERROR_GEN6 ); + error->gtfifodbg =I915_READ (GTFIFODBG ); error->bcs_acthd =I915_READ (BCS_ACTHD ); error->bcs_ipehr =I915_READ (BCS_IPEHR );drivers/gpu/drm/i915/i915_reg.h +0
-0
drivers/gpu/drm/i915/i915_reg.h line 3619
Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -3614,6 +3614,12 @@#define ECOBUS 0xa180#define FORCEWAKE_MT_ENABLE (1<<5) +#define GTFIFODBG 0x120000 +#define GT_FIFO_OVFERR (1<<2) +#define GT_FIFO_CPU_ERROR_MASK 3
Reading configdb it sounds like bit 2 is set when either bit 1 or bit 0 is set, but I might be wrong so imo it's better to check for all three bits.
Quoted 11 lines
drivers/gpu/drm/i915/i915_reg.h +3
-0+#define GT_FIFO_IAWRERR (1<<1) +#define GT_FIFO_IARDERR (1<<0) +#define GT_FIFO_FREE_ENTRIES 0x120008#define GT_FIFO_NUM_RESERVED_ENTRIES 20drivers/gpu/drm/i915/intel_display.c +0
-0
drivers/gpu/drm/i915/intel_display.c void gen6_enable_rps(struct drm_i915_private *dev_priv) · line 8219
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +2
-0@@ -8215,6 +8215,9 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)*/ I915_WRITE (GEN6_RC_STATE ,0 );mutex_lock (&dev_priv->dev->struct_mutex); +/* Clear the DBG now so we don't confuse earlier errors */ +I915_WRITE (GTFIFODBG ,GT_FIFO_CPU_ERROR_MASK );
I think we shouldn't silently clear errors here. Simplest might be a small inline helper to WARN_ON dirt in the gt fifo db reg - could be used in the later patches.
Quoted 11 lines
drivers/gpu/drm/i915/intel_display.c +1
-0+gen6_gt_force_wake_get (dev_priv);/* disable the counters and set deterministic thresholds */ Signature · 6 lines
1.7.9 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Quoted 76 lines · Daniel Vetter
Quoted 59 lines · Ben Widawsky
- Add register definitions for GTFIFODBG.
- Capture it at error time.
- Print it from debugfs (with whitespace fix).This register tells us if either a read, or a write occured while the fifo was full.
Signed-off-by Ben Widawsky <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 3 ++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_irq.c | 1 + drivers/gpu/drm/i915/i915_reg.h | 6 ++++++ drivers/gpu/drm/i915/intel_display.c | 3 +++ 5 files changed, 13 insertions(+), 1 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +2
-1@@ -760,7 +760,8 @@ static int i915_error_state(struct seq_file *m, void *unused)seq_printf (m,"EIR: 0x%08x\n" , error->eir);seq_printf (m,"PGTBL_ER: 0x%08x\n" , error->pgtbl_er);if (INTEL_INFO (dev)->gen >=6 ) { -seq_printf (m,"ERROR: 0x%08x\n" , error->error); +seq_printf (m,"ERROR: 0x%08x\n" , error->error); +seq_printf (m,"FIFODBG: 0x%08x\n" , error->gtfifodbg);seq_printf (m,"Blitter command stream:\n" );seq_printf (m," ACTHD: 0x%08x\n" , error->bcs_acthd);seq_printf (m," IPEIR: 0x%08x\n" , error->bcs_ipeir);drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -173,6 +173,7 @@ struct drm_i915_error_state {u32 seqno;u64 bbaddr;u64 fence[I915_MAX_NUM_FENCES ]; +u32 gtfifodbg;struct timeval time;struct drm_i915_error_object {int page_count;drivers/gpu/drm/i915/i915_irq.c +1
-0@@ -918,6 +918,7 @@ static void i915_capture_error_state(struct drm_device *dev) error->error =0 ;if (INTEL_INFO (dev)->gen >=6 ) { error->error =I915_READ (ERROR_GEN6 ); + error->gtfifodbg =I915_READ (GTFIFODBG ); error->bcs_acthd =I915_READ (BCS_ACTHD ); error->bcs_ipehr =I915_READ (BCS_IPEHR );drivers/gpu/drm/i915/i915_reg.h +0
-0drivers/gpu/drm/i915/i915_reg.h line 3619
Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -3614,6 +3614,12 @@#define ECOBUS 0xa180#define FORCEWAKE_MT_ENABLE (1<<5) +#define GTFIFODBG 0x120000 +#define GT_FIFO_OVFERR (1<<2) +#define GT_FIFO_CPU_ERROR_MASK 3Reading configdb it sounds like bit 2 is set when either bit 1 or bit 0 is set, but I might be wrong so imo it's better to check for all three bits.
Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +3
-0+#define GT_FIFO_IAWRERR (1<<1) +#define GT_FIFO_IARDERR (1<<0) +#define GT_FIFO_FREE_ENTRIES 0x120008#define GT_FIFO_NUM_RESERVED_ENTRIES 20
Quoted 14 lines
drivers/gpu/drm/i915/intel_display.c void gen6_enable_rps(struct drm_i915_private *dev_priv) · line 8219
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +2
-0@@ -8215,6 +8215,9 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)*/ I915_WRITE (GEN6_RC_STATE ,0 );mutex_lock (&dev_priv->dev->struct_mutex); +/* Clear the DBG now so we don't confuse earlier errors */ +I915_WRITE (GTFIFODBG ,GT_FIFO_CPU_ERROR_MASK );I think we shouldn't silently clear errors here. Simplest might be a small inline helper to
WARN_ONdirt in the gt fifo db reg - could be used in the later patches.
This reminds me, we have a few other error registers we should scrub upon init, along with the warning that something bad happened earlier. -Chris
Quoted 21 lines
Quoted 12 lines
drivers/gpu/drm/i915/intel_display.c +1
-0+gen6_gt_force_wake_get (dev_priv);/* disable the counters and set deterministic thresholds */ Signature · 6 lines
1.7.9 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 7 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre