Commit f4107766 authored by Chris Wilson's avatar Chris Wilson

drm/i915/hangcheck: Track context changes

Given sufficient preemption, we may see a busy system that doesn't
advance seqno while performing work across multiple contexts, and given
sufficient pathology not even notice a change in ACTHD. What does change
between the preempting contexts is their RING, so take note of that and
treat a change in the ring address as being an indication of forward
progress.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190501114541.10077-1-chris@chris-wilson.co.uk
parent d69ebf40
...@@ -53,6 +53,7 @@ struct intel_instdone { ...@@ -53,6 +53,7 @@ struct intel_instdone {
struct intel_engine_hangcheck { struct intel_engine_hangcheck {
u64 acthd; u64 acthd;
u32 last_ring;
u32 last_seqno; u32 last_seqno;
u32 next_seqno; u32 next_seqno;
unsigned long action_timestamp; unsigned long action_timestamp;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
struct hangcheck { struct hangcheck {
u64 acthd; u64 acthd;
u32 ring;
u32 seqno; u32 seqno;
enum intel_engine_hangcheck_action action; enum intel_engine_hangcheck_action action;
unsigned long action_timestamp; unsigned long action_timestamp;
...@@ -134,6 +135,7 @@ static void hangcheck_load_sample(struct intel_engine_cs *engine, ...@@ -134,6 +135,7 @@ static void hangcheck_load_sample(struct intel_engine_cs *engine,
{ {
hc->acthd = intel_engine_get_active_head(engine); hc->acthd = intel_engine_get_active_head(engine);
hc->seqno = intel_engine_get_hangcheck_seqno(engine); hc->seqno = intel_engine_get_hangcheck_seqno(engine);
hc->ring = ENGINE_READ(engine, RING_START);
} }
static void hangcheck_store_sample(struct intel_engine_cs *engine, static void hangcheck_store_sample(struct intel_engine_cs *engine,
...@@ -141,18 +143,22 @@ static void hangcheck_store_sample(struct intel_engine_cs *engine, ...@@ -141,18 +143,22 @@ static void hangcheck_store_sample(struct intel_engine_cs *engine,
{ {
engine->hangcheck.acthd = hc->acthd; engine->hangcheck.acthd = hc->acthd;
engine->hangcheck.last_seqno = hc->seqno; engine->hangcheck.last_seqno = hc->seqno;
engine->hangcheck.last_ring = hc->ring;
} }
static enum intel_engine_hangcheck_action static enum intel_engine_hangcheck_action
hangcheck_get_action(struct intel_engine_cs *engine, hangcheck_get_action(struct intel_engine_cs *engine,
const struct hangcheck *hc) const struct hangcheck *hc)
{ {
if (engine->hangcheck.last_seqno != hc->seqno)
return ENGINE_ACTIVE_SEQNO;
if (intel_engine_is_idle(engine)) if (intel_engine_is_idle(engine))
return ENGINE_IDLE; return ENGINE_IDLE;
if (engine->hangcheck.last_ring != hc->ring)
return ENGINE_ACTIVE_SEQNO;
if (engine->hangcheck.last_seqno != hc->seqno)
return ENGINE_ACTIVE_SEQNO;
return engine_stuck(engine, hc->acthd); return engine_stuck(engine, hc->acthd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment