drm/i915: hangcheck robustification
Subsystems (2)
PATCH 1/1 drm/i915: hangcheck robustification
This was pulled out of the per ring error handling patch series as it actually fixes two issues, and bikeshedding appears to be going on there.
First, remove setting hangcheck_count when we do notify ring. While it seems counterintuitive to be setting up a timer to catch hangcheck_count greater than 0 with hangcheck_count already greater than 0, actually when we go to check if the GPU is hung we clear that value if the gpu is still alive . Leaving this is actually harmful as submitting work could falsely clear the count while the hanghcheck code is checking the count. I can't think of case where this doesn't just delay the inevitable reset... but I didn't spend too much time thinking about it.
Second, for Gen5+ we have more information to be considered when determining if the GPU is stuck, primarily the media ring (and blitter ring in gen6). This patch will check all available rings, and also updates error state with the new information. It theoretically cant fix false positives, but I haven't actually come across such a case.
--- drivers/gpu/drm/i915/i915_debugfs.c | 6 +- drivers/gpu/drm/i915/i915_drv.h | 11 +-- drivers/gpu/drm/i915/i915_irq.c | 152 ++++++++++++++++++++++++---------- 3 files changed, 114 insertions(+), 55 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -3
@@ -752,20 +752,20 @@ static int i915_error_state(struct seq_file *m, void *unused)if (INTEL_INFO (dev)->gen >=6 ) {seq_printf (m,"ERROR: 0x%08x\n" , error->error);seq_printf (m,"Blitter command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->bcs_acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[BCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->bcs_ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->bcs_ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->bcs_instdone);seq_printf (m," seqno: 0x%08x\n" , error->bcs_seqno);seq_printf (m,"Video (BSD) command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->vcs_acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[VCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->vcs_ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->vcs_ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->vcs_instdone);seq_printf (m," seqno: 0x%08x\n" , error->vcs_seqno); }seq_printf (m,"Render command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[RCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->instdone);
drivers/gpu/drm/i915/i915_drv.h +4 -7
@@ -152,14 +152,12 @@ struct drm_i915_error_state {u32 ipeir;u32 ipehr;u32 instdone; -u32 acthd; +u32 acthd[I915_NUM_RINGS ];u32 error;/* gen6+ */ -u32 bcs_acthd;/* gen6+ blt engine */ u32 bcs_ipehr;u32 bcs_ipeir;u32 bcs_instdone;u32 bcs_seqno; -u32 vcs_acthd;/* gen6+ bsd engine */ u32 vcs_ipehr;u32 vcs_ipeir;u32 vcs_instdone;
@@ -330,10 +328,9 @@ typedef struct drm_i915_private {/* For hangcheck timer */ #define DRM_I915_HANGCHECK_PERIOD 1500/* in ms */ struct timer_list hangcheck_timer; -int hangcheck_count; -uint32_t last_acthd; -uint32_t last_instdone; -uint32_t last_instdone1; +int hangcheck_count;/* Should only be modified in hanghceck timer */ +uint32_t last_acthd[I915_NUM_RINGS ]; +uint64_t last_instdone[I915_NUM_RINGS ];unsigned long cfb_size;unsigned int cfb_fb;
drivers/gpu/drm/i915/i915_irq.c +107 -45
210 lines not on this page · raw message
Signature · 1 line
1.7.7