Commit 832265d3 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Include engine state on detecting a missed breadcrumb/seqno

Now that we have a common engine state pretty printer, we can use that
instead of the adhoc information printed when we miss a breadcrumb.

v2: Rearrange intel_engine_disarm_breadcrumbs() to avoid calling
intel_engine_dump() under the rb spinlock (Mika) and to pretty-print the
error state early so that we include the full list of waiters.
v3: Pass missed breadcrumb msg to pretty-printer as the header
v4: Preserve DRM_DEBUG_DRIVER filtering.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171208012303.25504-3-chris@chris-wilson.co.uk
parent 0db18b17
...@@ -64,12 +64,13 @@ static unsigned long wait_timeout(void) ...@@ -64,12 +64,13 @@ static unsigned long wait_timeout(void)
static noinline void missed_breadcrumb(struct intel_engine_cs *engine) static noinline void missed_breadcrumb(struct intel_engine_cs *engine)
{ {
DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS, irq posted? %s, current seqno=%x, last=%x\n", if (drm_debug & DRM_UT_DRIVER) {
engine->name, __builtin_return_address(0), struct drm_printer p = drm_debug_printer(__func__);
yesno(test_bit(ENGINE_IRQ_BREADCRUMB,
&engine->irq_posted)), intel_engine_dump(engine, &p,
intel_engine_get_seqno(engine), "%s missed breadcrumb at %pS\n",
intel_engine_last_submit(engine)); engine->name, __builtin_return_address(0));
}
set_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings); set_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings);
} }
...@@ -213,28 +214,30 @@ void intel_engine_unpin_breadcrumbs_irq(struct intel_engine_cs *engine) ...@@ -213,28 +214,30 @@ void intel_engine_unpin_breadcrumbs_irq(struct intel_engine_cs *engine)
void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine) void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine)
{ {
struct intel_breadcrumbs *b = &engine->breadcrumbs; struct intel_breadcrumbs *b = &engine->breadcrumbs;
struct intel_wait *wait, *n, *first; struct intel_wait *wait, *n;
if (!b->irq_armed) if (!b->irq_armed)
return; return;
/* We only disarm the irq when we are idle (all requests completed), /*
* We only disarm the irq when we are idle (all requests completed),
* so if the bottom-half remains asleep, it missed the request * so if the bottom-half remains asleep, it missed the request
* completion. * completion.
*/ */
if (intel_engine_wakeup(engine) & ENGINE_WAKEUP_ASLEEP)
missed_breadcrumb(engine);
spin_lock_irq(&b->rb_lock); spin_lock_irq(&b->rb_lock);
spin_lock(&b->irq_lock); spin_lock(&b->irq_lock);
first = fetch_and_zero(&b->irq_wait); b->irq_wait = NULL;
if (b->irq_armed) if (b->irq_armed)
__intel_engine_disarm_breadcrumbs(engine); __intel_engine_disarm_breadcrumbs(engine);
spin_unlock(&b->irq_lock); spin_unlock(&b->irq_lock);
rbtree_postorder_for_each_entry_safe(wait, n, &b->waiters, node) { rbtree_postorder_for_each_entry_safe(wait, n, &b->waiters, node) {
RB_CLEAR_NODE(&wait->node); RB_CLEAR_NODE(&wait->node);
if (wake_up_process(wait->tsk) && wait == first) wake_up_process(wait->tsk);
missed_breadcrumb(engine);
} }
b->waiters = RB_ROOT; b->waiters = RB_ROOT;
......
...@@ -1836,6 +1836,12 @@ void intel_engine_dump(struct intel_engine_cs *engine, ...@@ -1836,6 +1836,12 @@ void intel_engine_dump(struct intel_engine_cs *engine,
} }
spin_unlock_irq(&b->rb_lock); spin_unlock_irq(&b->rb_lock);
drm_printf(m, "IRQ? 0x%lx (breadcrumbs? %s) (execlists? %s)\n",
engine->irq_posted,
yesno(test_bit(ENGINE_IRQ_BREADCRUMB,
&engine->irq_posted)),
yesno(test_bit(ENGINE_IRQ_EXECLIST,
&engine->irq_posted)));
drm_printf(m, "Idle? %s\n", yesno(intel_engine_is_idle(engine))); drm_printf(m, "Idle? %s\n", yesno(intel_engine_is_idle(engine)));
drm_printf(m, "\n"); drm_printf(m, "\n");
} }
......
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