On Tue, Feb 07, 2012 at 04:21:49PM +0100, Ben Widawsky wrote: > 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. > > v2: Replace POSTING_READ with I915_READ_NOTRACE(GTFIFODBG). Recommended > by Chris Wilson > > v3: Pull the fifo check out into a helper function to reduce code > duplication > > Signed-off-by: Ben Widawsky <ben at bwidawsk.net> > --- > drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++++++-- > 1 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c > index 1658cfd..a7858a1 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -379,16 +379,27 @@ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) > dev_priv->display.force_wake_get(dev_priv); > } > > +static void gen6_gt_check_fifodbg(struct drm_i915_private *dev_priv) > +{ > + u32 gtfifodbg; > + gtfifodbg = I915_READ_NOTRACE(GTFIFODBG); > + WARN(gtfifodbg & GT_FIFO_CPU_ERROR_MASK, > + "MMIO read or write has been dropped %x\n", gtfifodbg); > + I915_WRITE_NOTRACE(GTFIFODBG, GT_FIFO_CPU_ERROR_MASK); I think we should move the write out of line and only do it when we're actually catching an error. -Daniel -- Daniel Vetter Mail: daniel at ffwll.ch Mobile: +41 (0)79 365 57 48