diff options
author | Chris Wilson <[email protected]> | 2022-09-13 17:21:50 +0200 |
---|---|---|
committer | Andi Shyti <[email protected]> | 2022-09-14 13:21:14 +0200 |
commit | 25e4b26672a0908078e10733eb20efa20800e534 (patch) | |
tree | ec9f868d814e8fb958717eb6e63f4492e4f94e61 | |
parent | a062b8cf811d49b7ba7203d0ec5bd9fe0b61c66e (diff) |
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: CQ Tang <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Cc: CQ Tang <[email protected]>
cc: Joonas Lahtinen <[email protected]>
Signed-off-by: Ramalingam C <[email protected]>
Reviewed-by: Thomas Hellstrom <[email protected]>
Signed-off-by: Karolina Drobnik <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Signed-off-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/8b7781f7dbaf2791156491b76d5faa7852e5cbbb.1663081418.git.karolina.drobnik@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/gt/selftest_lrc.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c index 8320eab7ac36..71e664fc87e9 100644 --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c @@ -1460,18 +1460,17 @@ static int __lrc_isolation(struct intel_engine_cs *engine, u32 poison) } err = poison_registers(B, poison, sema); - if (err) { - WRITE_ONCE(*sema, -1); - i915_request_put(rq); - goto err_result1; - } - - if (i915_request_wait(rq, 0, HZ / 2) < 0) { - i915_request_put(rq); + if (err == 0 && i915_request_wait(rq, 0, HZ / 2) < 0) { + pr_err("%s(%s): wait for results timed out\n", + __func__, engine->name); 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); + if (err) + goto err_result1; err = compare_isolation(engine, ref, result, A, poison); |