]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Clear stop-engine for a pardoned reset
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 14 Aug 2018 17:18:57 +0000 (18:18 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 15 Aug 2018 09:15:28 +0000 (10:15 +0100)
If we pardon a per-engine reset, we may leave the STOP_RING bit asserted
in RING_MI_MODE resulting in the engine hanging. Unconditionally clear
it on the per-engine exit path as we know that either we skipped the
reset and so need the cancellation, or the reset was successful and the
cancellation is a no-op, or there was an error and we will follow up
with a full-reset or wedging (both of which will stop the engines again
as required).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106560
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180814171857.24673-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_engine_cs.c
drivers/gpu/drm/i915/intel_ringbuffer.h

index 9dce55182c3a20e26760fa681fb76f47b3e67b79..41111f2a9c39dff134420924658f5e365e37db9e 100644 (file)
@@ -2079,6 +2079,7 @@ int i915_reset_engine(struct intel_engine_cs *engine, const char *msg)
                goto out;
 
 out:
+       intel_engine_cancel_stop_cs(engine);
        i915_gem_reset_finish_engine(engine);
        return ret;
 }
index 99d5a24219c13041c83cfa226ca958a7b51a98d9..8628567d8f6ea30d3ce3b8d0438d7be7b9e336fb 100644 (file)
@@ -788,6 +788,16 @@ int intel_engine_stop_cs(struct intel_engine_cs *engine)
        return err;
 }
 
+void intel_engine_cancel_stop_cs(struct intel_engine_cs *engine)
+{
+       struct drm_i915_private *dev_priv = engine->i915;
+
+       GEM_TRACE("%s\n", engine->name);
+
+       I915_WRITE_FW(RING_MI_MODE(engine->mmio_base),
+                     _MASKED_BIT_DISABLE(STOP_RING));
+}
+
 const char *i915_cache_level_str(struct drm_i915_private *i915, int type)
 {
        switch (type) {
index 9090885d57dea5bf224b52d66f8fec936a794cbf..3f6920dd78806abc8e6fce953186391e04cb5629 100644 (file)
@@ -906,6 +906,7 @@ int intel_init_blt_ring_buffer(struct intel_engine_cs *engine);
 int intel_init_vebox_ring_buffer(struct intel_engine_cs *engine);
 
 int intel_engine_stop_cs(struct intel_engine_cs *engine);
+void intel_engine_cancel_stop_cs(struct intel_engine_cs *engine);
 
 u64 intel_engine_get_active_head(const struct intel_engine_cs *engine);
 u64 intel_engine_get_last_batch_head(const struct intel_engine_cs *engine);