提交 0364cd19 编写于 作者: C Chris Wilson 提交者: Daniel Vetter

drm/i915: Serialize per-engine resets against new requests

We rely on disabling the execlists (by stopping the tasklet) to prevent
new requests from submitting to the engine ELSP before we are ready.
However, we re-enable the engine before we call init_hw which gives
userspace the opportunity to subit a new request which is then
overwritten by init_hw -- but not before the HW may have started
executing. The subsequent out-of-order CSB is detected by our sanity
checks in intel_lrc_irq_handler().

Fixes: a1ef70e1 ("drm/i915: Add support for per engine reset recovery")
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170721123238.16428-3-chris@chris-wilson.co.ukSigned-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 b4f3e163
...@@ -1951,6 +1951,12 @@ int i915_reset_engine(struct intel_engine_cs *engine) ...@@ -1951,6 +1951,12 @@ int i915_reset_engine(struct intel_engine_cs *engine)
} }
ret = intel_gpu_reset(engine->i915, intel_engine_flag(engine)); ret = intel_gpu_reset(engine->i915, intel_engine_flag(engine));
if (ret) {
/* If we fail here, we expect to fallback to a global reset */
DRM_DEBUG_DRIVER("Failed to reset %s, ret=%d\n",
engine->name, ret);
goto out;
}
/* /*
* The request that caused the hang is stuck on elsp, we know the * The request that caused the hang is stuck on elsp, we know the
...@@ -1959,15 +1965,6 @@ int i915_reset_engine(struct intel_engine_cs *engine) ...@@ -1959,15 +1965,6 @@ int i915_reset_engine(struct intel_engine_cs *engine)
*/ */
i915_gem_reset_engine(engine, active_request); i915_gem_reset_engine(engine, active_request);
i915_gem_reset_finish_engine(engine);
if (ret) {
/* If we fail here, we expect to fallback to a global reset */
DRM_DEBUG_DRIVER("Failed to reset %s, ret=%d\n",
engine->name, ret);
goto out;
}
/* /*
* The engine and its registers (and workarounds in case of render) * The engine and its registers (and workarounds in case of render)
* have been reset to their default values. Follow the init_ring * have been reset to their default values. Follow the init_ring
...@@ -1979,6 +1976,7 @@ int i915_reset_engine(struct intel_engine_cs *engine) ...@@ -1979,6 +1976,7 @@ int i915_reset_engine(struct intel_engine_cs *engine)
error->reset_engine_count[engine->id]++; error->reset_engine_count[engine->id]++;
out: out:
i915_gem_reset_finish_engine(engine);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册