提交 25e4b266 编写于 作者: C Chris Wilson 提交者: Andi Shyti

drm/i915/selftest: Always cancel semaphore on error

Ensure that we always signal the semaphore when timing out, so that if it
happens to be stuck waiting for the semaphore we will quickly recover
without having to wait for a reset.
Reported-by: NCQ Tang <cq.tang@intel.com>
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Cc: CQ Tang <cq.tang@intel.com>
cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: NRamalingam C <ramalingam.c@intel.com>
Reviewed-by: NThomas Hellstrom <thomas.hellstrom@linux.intel.com>
Signed-off-by: NKarolina Drobnik <karolina.drobnik@intel.com>
Reviewed-by: NAndi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: NAndi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8b7781f7dbaf2791156491b76d5faa7852e5cbbb.1663081418.git.karolina.drobnik@intel.com
上级 a062b8cf
...@@ -1460,18 +1460,17 @@ static int __lrc_isolation(struct intel_engine_cs *engine, u32 poison) ...@@ -1460,18 +1460,17 @@ static int __lrc_isolation(struct intel_engine_cs *engine, u32 poison)
} }
err = poison_registers(B, poison, sema); err = poison_registers(B, poison, sema);
if (err) { if (err == 0 && i915_request_wait(rq, 0, HZ / 2) < 0) {
WRITE_ONCE(*sema, -1); pr_err("%s(%s): wait for results timed out\n",
i915_request_put(rq); __func__, engine->name);
goto err_result1;
}
if (i915_request_wait(rq, 0, HZ / 2) < 0) {
i915_request_put(rq);
err = -ETIME; err = -ETIME;
goto err_result1;
} }
/* Always cancel the semaphore wait, just in case the GPU gets stuck */
WRITE_ONCE(*sema, -1);
i915_request_put(rq); i915_request_put(rq);
if (err)
goto err_result1;
err = compare_isolation(engine, ref, result, A, poison); err = compare_isolation(engine, ref, result, A, poison);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册