summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_request.c
diff options
context:
space:
mode:
authorChris Wilson2019-02-13 19:27:37 +0100
committerChris Wilson2019-02-15 13:59:26 +0100
commitd9e61b66a5d305bbf052a70a853b3be680d911ba (patch)
tree844fd1334d53b561bb00b687167f31467b4af698 /drivers/gpu/drm/i915/i915_request.c
parentdrm/i915/selftests: Always use an active engine while resetting (diff)
downloadkernel-qcow2-linux-d9e61b66a5d305bbf052a70a853b3be680d911ba.tar.gz
kernel-qcow2-linux-d9e61b66a5d305bbf052a70a853b3be680d911ba.tar.xz
kernel-qcow2-linux-d9e61b66a5d305bbf052a70a853b3be680d911ba.zip
drm/i915: Defer application of request banning to submission
As we currently do not check on submission whether the context is banned in a timely manner it is possible for some requests to escape cancellation after their parent context is banned. By moving the ban into the request submission under the engine->timeline.lock, we serialise it with the reset and setting of the context ban. References: eb8d0f5af4ec ("drm/i915: Remove GPU reset dependence on struct_mutex") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190213182737.12695-1-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_request.c')
-rw-r--r--drivers/gpu/drm/i915/i915_request.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 0acd6baa3c88..5ab4e1c01618 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -366,6 +366,9 @@ void __i915_request_submit(struct i915_request *request)
GEM_BUG_ON(!irqs_disabled());
lockdep_assert_held(&engine->timeline.lock);
+ if (i915_gem_context_is_banned(request->gem_context))
+ i915_request_skip(request, -EIO);
+
GEM_BUG_ON(request->global_seqno);
seqno = next_global_seqno(&engine->timeline);