diff options
author | Oscar Mateo <oscar.mateo@intel.com> | 2017-12-22 17:38:49 -0500 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2018-02-01 10:31:38 -0500 |
commit | 25da77f83068bfc95d08ddfb8e6c53983901e278 (patch) | |
tree | b17b39e1af7f0870295b6d6d3f9b297d61e8384b | |
parent | c950af50e5983a119bebedceed94ef505df8d552 (diff) |
drm/i915: Stop getting the fault address from RING_FAULT_REG
This register does not contain it. Instead, we have to look into FAULT_TLB_DATA0 & 1
(where, by the way, we can also get the address space).
v2: Right formatting
v3:
- Use 12 (as per the register format) instead of PAGE_SIZE (Chris)
- s/BITS_44_TO_47/HIGHBITS (Chris)
- Right formatting, this time for real
Fixes: b03ec3d67ab8 ("drm/i915: There is only one fault register from GEN8 onwards")
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/1513982329-32191-1-git-send-email-oscar.mateo@intel.com
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 5a3f58dfd1420347be838546e00a4a9e847bda30)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index c5f393870532..0de4f3f13fc4 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -2287,12 +2287,23 @@ static void gen8_check_and_clear_faults(struct drm_i915_private *dev_priv) | |||
2287 | u32 fault = I915_READ(GEN8_RING_FAULT_REG); | 2287 | u32 fault = I915_READ(GEN8_RING_FAULT_REG); |
2288 | 2288 | ||
2289 | if (fault & RING_FAULT_VALID) { | 2289 | if (fault & RING_FAULT_VALID) { |
2290 | u32 fault_data0, fault_data1; | ||
2291 | u64 fault_addr; | ||
2292 | |||
2293 | fault_data0 = I915_READ(GEN8_FAULT_TLB_DATA0); | ||
2294 | fault_data1 = I915_READ(GEN8_FAULT_TLB_DATA1); | ||
2295 | fault_addr = ((u64)(fault_data1 & FAULT_VA_HIGH_BITS) << 44) | | ||
2296 | ((u64)fault_data0 << 12); | ||
2297 | |||
2290 | DRM_DEBUG_DRIVER("Unexpected fault\n" | 2298 | DRM_DEBUG_DRIVER("Unexpected fault\n" |
2291 | "\tAddr: 0x%08lx\n" | 2299 | "\tAddr: 0x%08x_%08x\n" |
2300 | "\tAddress space: %s\n" | ||
2292 | "\tEngine ID: %d\n" | 2301 | "\tEngine ID: %d\n" |
2293 | "\tSource ID: %d\n" | 2302 | "\tSource ID: %d\n" |
2294 | "\tType: %d\n", | 2303 | "\tType: %d\n", |
2295 | fault & PAGE_MASK, | 2304 | upper_32_bits(fault_addr), |
2305 | lower_32_bits(fault_addr), | ||
2306 | fault_data1 & FAULT_GTT_SEL ? "GGTT" : "PPGTT", | ||
2296 | GEN8_RING_FAULT_ENGINE_ID(fault), | 2307 | GEN8_RING_FAULT_ENGINE_ID(fault), |
2297 | RING_FAULT_SRCID(fault), | 2308 | RING_FAULT_SRCID(fault), |
2298 | RING_FAULT_FAULT_TYPE(fault)); | 2309 | RING_FAULT_FAULT_TYPE(fault)); |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 505c605eff98..a2108e35c599 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -2489,6 +2489,8 @@ enum i915_power_well_id { | |||
2489 | 2489 | ||
2490 | #define GEN8_FAULT_TLB_DATA0 _MMIO(0x4b10) | 2490 | #define GEN8_FAULT_TLB_DATA0 _MMIO(0x4b10) |
2491 | #define GEN8_FAULT_TLB_DATA1 _MMIO(0x4b14) | 2491 | #define GEN8_FAULT_TLB_DATA1 _MMIO(0x4b14) |
2492 | #define FAULT_VA_HIGH_BITS (0xf << 0) | ||
2493 | #define FAULT_GTT_SEL (1 << 4) | ||
2492 | 2494 | ||
2493 | #define FPGA_DBG _MMIO(0x42300) | 2495 | #define FPGA_DBG _MMIO(0x42300) |
2494 | #define FPGA_DBG_RM_NOCLAIM (1<<31) | 2496 | #define FPGA_DBG_RM_NOCLAIM (1<<31) |