All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Detect page faults during hangcheck
@ 2014-12-05 14:15 Chris Wilson
  2014-12-05 14:15 ` [PATCH 2/2] drm/i915: Reorder hw init to avoid executing with invalid context/mm state Chris Wilson
  2014-12-05 21:03 ` [PATCH 1/2] drm/i915: Detect page faults during hangcheck Daniel Vetter
  0 siblings, 2 replies; 16+ messages in thread
From: Chris Wilson @ 2014-12-05 14:15 UTC (permalink / raw)
  To: intel-gfx

On Sandybridge+, the GPU provides the ERROR register for detecting page
faults. Hook this up to our hangcheck so that we can dump the error
state soon after such an event occurs. This would be better inside an
interrupt handler, but it serves a purpose here as it detects that our
initial context setup is invalid...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_irq.c     | 5 +++++
 drivers/gpu/drm/i915/intel_uncore.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 7913a72ce30a..eb2149b941e4 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2969,6 +2969,11 @@ static void i915_hangcheck_elapsed(unsigned long data)
 	if (!i915.enable_hangcheck)
 		return;
 
+	if (INTEL_INFO(dev_priv)->gen >= 6 && I915_READ(ERROR_GEN6)) {
+		i915_handle_error(dev, false, "GPU reported a page fault");
+		I915_WRITE(ERROR_GEN6, 0);
+	}
+
 	for_each_ring(ring, dev_priv, i) {
 		u64 acthd;
 		u32 seqno;
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 0655b44651a7..67f2e24c5bc5 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -535,6 +535,8 @@ static void __intel_uncore_early_sanitize(struct drm_device *dev,
 	if (IS_GEN6(dev) || IS_GEN7(dev))
 		__raw_i915_write32(dev_priv, GTFIFODBG,
 				   __raw_i915_read32(dev_priv, GTFIFODBG));
+	if (INTEL_INFO(dev)->gen >= 6)
+		__raw_i915_write32(dev_priv, ERROR_GEN6, 0);
 
 	intel_uncore_forcewake_reset(dev, restore_forcewake);
 }
-- 
2.1.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-01-21 11:21 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-05 14:15 [PATCH 1/2] drm/i915: Detect page faults during hangcheck Chris Wilson
2014-12-05 14:15 ` [PATCH 2/2] drm/i915: Reorder hw init to avoid executing with invalid context/mm state Chris Wilson
2014-12-05 14:31   ` Ville Syrjälä
2014-12-05 14:38     ` Chris Wilson
2014-12-05 14:53       ` Ville Syrjälä
2014-12-05 16:26         ` Chris Wilson
2014-12-05 17:03           ` Ville Syrjälä
2015-01-21 10:12             ` Chris Wilson
2015-01-21 11:21               ` Ville Syrjälä
2014-12-05 14:58       ` Daniel Vetter
2014-12-05 16:23         ` Chris Wilson
2014-12-05 21:01           ` Daniel Vetter
2015-01-20 14:55   ` Mika Kuoppala
2015-01-21 10:09     ` Chris Wilson
2014-12-05 21:03 ` [PATCH 1/2] drm/i915: Detect page faults during hangcheck Daniel Vetter
2015-01-21 10:05   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.