]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Propagate error from cancelled submit due to context closure
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 3 Dec 2020 10:34:32 +0000 (10:34 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 4 Dec 2020 11:27:57 +0000 (11:27 +0000)
commitc6147c3216f64e537c2e8288d1cddd07602d56b0
tree97e7acf7e2abaab511baadce564019eb194e0fdd
parenta1d14a3b9b7934eead1715fe3e456de98c0a480e
drm/i915/gem: Propagate error from cancelled submit due to context closure

In the course of discovering and closing many races with context closure
and execbuf submission, since commit 728ea0a5a4c8 ("drm/i915/gem: Check
that the context wasn't closed during setup") we started checking that
the context was not closed by another userspace thread during the execbuf
ioctl. In doing so we cancelled the inflight request (by telling it to be
skipped), but kept reporting success since we do submit a request, albeit
one that doesn't execute. As the error is known before we return from the
ioctl, we can report the error we detect immediately, rather than leave
it on the fence status. With the immediate propagation of the error, it
is easier for userspace to handle.

Fixes: 728ea0a5a4c8 ("drm/i915/gem: Check that the context wasn't closed during setup")
Testcase: igt/gem_ctx_exec/basic-close-race
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: <stable@vger.kernel.org> # v5.7+
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201203103432.31526-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c