]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/gt: Check engine-is-awake on reset later
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 27 Feb 2020 20:47:27 +0000 (20:47 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 28 Feb 2020 09:30:14 +0000 (09:30 +0000)
As we drop the engine-pm on retiring, that may happen while there are
still CS events in the buffer. As such we cannot assert the engine is
still active on reset, until we know that the current request is still
in flight.

Closes: https://gitlab.freedesktop.org/drm/intel/issues/1338
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227204727.2009346-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_lrc.c

index 39b0125b71434a895e21113bd7a317258c18a476..e262571fb00ce844dfbb36e64ffa61f44c942402 100644 (file)
@@ -3637,9 +3637,6 @@ static void __execlists_reset(struct intel_engine_cs *engine, bool stalled)
        if (!rq)
                goto unwind;
 
-       /* We still have requests in-flight; the engine should be active */
-       GEM_BUG_ON(!intel_engine_pm_is_awake(engine));
-
        ce = rq->context;
        GEM_BUG_ON(!i915_vma_is_pinned(ce->state));
 
@@ -3649,8 +3646,12 @@ static void __execlists_reset(struct intel_engine_cs *engine, bool stalled)
                goto out_replay;
        }
 
+       /* We still have requests in-flight; the engine should be active */
+       GEM_BUG_ON(!intel_engine_pm_is_awake(engine));
+
        /* Context has requests still in-flight; it should not be idle! */
        GEM_BUG_ON(i915_active_is_idle(&ce->active));
+
        rq = active_request(ce->timeline, rq);
        head = intel_ring_wrap(ce->ring, rq->head);
        GEM_BUG_ON(head == ce->ring->tail);