linux/drivers/gpu/drm/i915/gem
Chris Wilson 0e124e19ce 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 61231f6bd0 ("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: 61231f6bd0 ("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
(cherry picked from commit ba38b79eae)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2020-12-08 07:03:27 -08:00
..
selftests drm-misc-next for 5.10: 2020-09-23 09:52:24 +10:00
i915_gem_busy.c drm/i915: Align engine->uabi_class/instance with i915_drm.h 2020-01-20 09:13:01 +00:00
i915_gem_clflush.c drm/i915: Replace the hardcoded I915_FENCE_TIMEOUT 2020-05-09 12:57:57 +01:00
i915_gem_clflush.h
i915_gem_client_blt.c drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2. 2020-09-07 14:31:22 +03:00
i915_gem_client_blt.h
i915_gem_context_types.h drm/i915/gem: Split the context's obj:vma lut into its own mutex 2020-07-03 10:13:13 +01:00
i915_gem_context.c drm/i915/gem: Always test execution status on closing the context 2020-09-30 14:24:51 -04:00
i915_gem_context.h drm/i915/sseu: Move sseu_info under gt_info 2020-07-08 21:13:09 +01:00
i915_gem_dmabuf.c Merge branch 'for-5.10-drm-sg-fix' of https://github.com/mszyprow/linux into drm-next 2020-09-17 16:07:11 +10:00
i915_gem_domain.c drm/i915/gem: Flush coherency domains on first set-domain-ioctl 2020-11-03 19:14:03 -05:00
i915_gem_execbuffer.c drm/i915/gem: Propagate error from cancelled submit due to context closure 2020-12-08 07:03:27 -08:00
i915_gem_fence.c drm/i915: Replace the hardcoded I915_FENCE_TIMEOUT 2020-05-09 12:57:57 +01:00
i915_gem_internal.c drm/i915/gem: Give each object class a friendly name 2020-05-29 23:38:29 +01:00
i915_gem_ioctls.h drm/i915: Introduce DRM_I915_GEM_MMAP_OFFSET 2019-12-04 15:11:44 +00:00
i915_gem_lmem.c drm/i915/gem: Give each object class a friendly name 2020-05-29 23:38:29 +01:00
i915_gem_lmem.h drm/i915/gem: Support discontiguous lmem object maps 2020-01-03 11:26:01 +00:00
i915_gem_mman.c Merge tag 'drm-intel-gt-next-2020-09-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2020-09-09 07:55:22 +10:00
i915_gem_mman.h drm/i915/gem: Only revoke mmap handlers if active 2020-07-02 20:46:08 +01:00
i915_gem_object_blt.c drm/i915: Fix an error code i915_gem_object_copy_blt() 2020-09-30 14:24:28 -04:00
i915_gem_object_blt.h drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2. 2020-09-07 14:31:22 +03:00
i915_gem_object_types.h drm/i915/gem: Allow backends to override pread implementation 2020-11-12 19:47:30 -05:00
i915_gem_object.c drm/i915/gem: Split the context's obj:vma lut into its own mutex 2020-07-03 10:13:13 +01:00
i915_gem_object.h Merge tag 'drm-intel-gt-next-2020-09-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2020-09-09 07:55:22 +10:00
i915_gem_pages.c drm/i915: use vmap in i915_gem_object_map 2020-10-18 09:27:10 -07:00
i915_gem_phys.c drm/i915/gem: Pull phys pread/pwrite implementations to the backend 2020-11-12 19:47:30 -05:00
i915_gem_pm.c drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2. 2020-09-07 14:29:44 +03:00
i915_gem_pm.h drm/i915: Teach record_defaults to operate on the intel_gt 2019-10-22 20:43:07 +01:00
i915_gem_region.c drm/i915/gem: Single page objects are naturally contiguous 2020-01-02 21:21:17 +00:00
i915_gem_region.h
i915_gem_shmem.c i915: use find_lock_page instead of find_lock_entry 2020-10-13 18:38:29 -07:00
i915_gem_shrinker.c drm/i915/gem: Unpin idle contexts from kswapd reclaim 2020-07-08 22:05:49 +01:00
i915_gem_shrinker.h
i915_gem_stolen.c drm/i915: Exclude low pages (128KiB) of stolen from use 2020-10-21 08:32:28 -04:00
i915_gem_stolen.h drm/i915: Exclude low pages (128KiB) of stolen from use 2020-10-21 08:32:28 -04:00
i915_gem_throttle.c drm/i915/gem: Remove disordered per-file request list for throttling 2020-09-07 13:13:50 +03:00
i915_gem_tiling.c drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2. 2020-09-07 14:29:44 +03:00
i915_gem_userptr.c lib/scatterlist: Add support in dynamic allocation of SG table from pages 2020-10-05 20:45:45 -03:00
i915_gem_wait.c
i915_gemfs.c
i915_gemfs.h