Commit 44a02705 authored by Chris Wilson's avatar Chris Wilson Committed by Jani Nikula

drm/i915: Check for timeout completion when waiting for the rq to submitted

We first wait for a request to be submitted to hw and assigned a seqno,
before we can wait for the hw to signal completion (otherwise we don't
know the hw id we need to wait upon). Whilst waiting for the request to
be submitted, we may exceed the user's timeout and need to propagate the
error back.

v2: Make ETIME into an error from wait_for_execute for consistent exit
handling.
Reported-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: 4680816b ("drm/i915: Wait first for submission, before waiting for request completion")
Testcase: igt/gem_wait/basic-await
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
Cc: stable@vger.kernel.org
Link: http://patchwork.freedesktop.org/patch/msgid/20170208181238.7232-1-chris@chris-wilson.co.ukReviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
(cherry picked from commit 969bb72c)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 3e52d71e
...@@ -1025,8 +1025,13 @@ __i915_request_wait_for_execute(struct drm_i915_gem_request *request, ...@@ -1025,8 +1025,13 @@ __i915_request_wait_for_execute(struct drm_i915_gem_request *request,
break; break;
} }
if (!timeout) {
timeout = -ETIME;
break;
}
timeout = io_schedule_timeout(timeout); timeout = io_schedule_timeout(timeout);
} while (timeout); } while (1);
finish_wait(&request->execute.wait, &wait); finish_wait(&request->execute.wait, &wait);
if (flags & I915_WAIT_LOCKED) if (flags & I915_WAIT_LOCKED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment