drm/i915: Find unclaimed MMIO writes.
authorBen Widawsky <ben@bwidawsk.net>
Mon, 20 Aug 2012 23:15:14 +0000 (16:15 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 22 Aug 2012 16:06:26 +0000 (18:06 +0200)
ERR_INT on HSW will display unclaimed MMIO accesses. This can be either
the result of a driver bug writing to an invalid addresses, or the
result of RC6.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_reg.h

index 7ebb13b651338c7d300783326710a00e55d6601a..7f3863fb138c65b8f869c756ae7ac6f204bc3bad 100644 (file)
@@ -1174,6 +1174,10 @@ void i915_write##x(struct drm_i915_private *dev_priv, u32 reg, u##x val) { \
        if (unlikely(__fifo_ret)) { \
                gen6_gt_check_fifodbg(dev_priv); \
        } \
+       if (IS_HASWELL(dev_priv->dev) && (I915_READ_NOTRACE(GEN7_ERR_INT) & ERR_INT_MMIO_UNCLAIMED)) { \
+               DRM_ERROR("Unclaimed write to %x\n", reg); \
+               writel(ERR_INT_MMIO_UNCLAIMED, dev_priv->regs + GEN7_ERR_INT);  \
+       } \
 }
 __i915_write(8, b)
 __i915_write(16, w)
index a20885c0f35fb1f2a8fc8721f90c5cc49862eb9d..f27e9982bed0f9bf77f44c9f74c50282535d2e96 100644 (file)
 
 #define ERROR_GEN6     0x040a0
 #define GEN7_ERR_INT   0x44040
+#define   ERR_INT_MMIO_UNCLAIMED (1<<13)
 
 /* GM45+ chicken bits -- debug workaround bits that may be required
  * for various sorts of correct behavior.  The top 16 bits of each are