diff options
author | Chris Wilson <[email protected]> | 2020-02-14 12:06:59 +0000 |
---|---|---|
committer | Chris Wilson <[email protected]> | 2020-02-14 15:47:24 +0000 |
commit | fcf7df7aae24facdedf42d76842e97ecc2f5d5bb (patch) | |
tree | a1f5036e9c656a2b8c57ef27b4dd8a14cf4c3c91 | |
parent | 926b005cd8c4e325ab918edea0fbdd1d25d1ba28 (diff) |
drm/i915/selftests: Check for the error interrupt before we wait!
Sometimes the error interrupt can fire even before we have seen the
request go active -- in which case, we end up waiting until the timeout
as the request is already completed. Double check for this case!
Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/i915/gt/selftest_lrc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c index 3a74a54739a8..64761e619876 100644 --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c @@ -76,11 +76,15 @@ static int wait_for_submit(struct intel_engine_cs *engine, do { cond_resched(); intel_engine_flush_submission(engine); + if (i915_request_is_active(rq) && !READ_ONCE(engine->execlists.pending[0])) { tasklet_unlock_wait(&engine->execlists.tasklet); return 0; } + + if (i915_request_completed(rq)) /* that was quick! */ + return 0; } while (time_before(jiffies, timeout)); return -ETIME; |