All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Matthew Auld <matthew.auld@intel.com>
Subject: [Intel-gfx] [PATCH 09/14] drm/i915/gt: Prevent allocation on a banned context
Date: Mon, 24 Feb 2020 10:00:02 +0000	[thread overview]
Message-ID: <20200224100007.4024184-9-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20200224100007.4024184-1-chris@chris-wilson.co.uk>

If a context is banned even before we submit our first request to it,
report the failure before we attempt to allocate any resources for the
context.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_context.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
index 8bb444cda14f..01474d3a558b 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.c
+++ b/drivers/gpu/drm/i915/gt/intel_context.c
@@ -51,6 +51,11 @@ int intel_context_alloc_state(struct intel_context *ce)
 		return -EINTR;
 
 	if (!test_bit(CONTEXT_ALLOC_BIT, &ce->flags)) {
+		if (intel_context_is_banned(ce)) {
+			err = -EIO;
+			goto unlock;
+		}
+
 		err = ce->ops->alloc(ce);
 		if (unlikely(err))
 			goto unlock;
-- 
2.25.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2020-02-24 10:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24  9:59 [Intel-gfx] [PATCH 01/14] drm/i915/selftests: Verify LRC isolation Chris Wilson
2020-02-24  9:59 ` [Intel-gfx] [PATCH 02/14] drm/i915/selftests: Check recovery from corrupted LRC Chris Wilson
2020-02-24  9:59 ` [Intel-gfx] [PATCH 03/14] drm/i915: Flush idle barriers when waiting Chris Wilson
2020-02-25 19:07   ` Tvrtko Ursulin
2020-02-25 19:16     ` Chris Wilson
2020-02-24  9:59 ` [Intel-gfx] [PATCH 04/14] drm/i915: Allow userspace to specify ringsize on construction Chris Wilson
2020-02-24  9:59 ` [Intel-gfx] [PATCH 05/14] drm/i915/gem: Honour O_NONBLOCK before throttling execbuf submissions Chris Wilson
2020-02-24  9:59 ` [Intel-gfx] [PATCH 06/14] drm/i915/selftests: Be a little more lenient for reset workers Chris Wilson
2020-02-24 10:00 ` [Intel-gfx] [PATCH 07/14] drm/i915: Protect i915_request_await_start from early waits Chris Wilson
2020-02-24 10:00 ` [Intel-gfx] [PATCH 08/14] drm/i915/gem: Consolidate ctx->engines[] release Chris Wilson
2020-02-24 10:00 ` Chris Wilson [this message]
2020-02-24 10:00 ` [Intel-gfx] [PATCH 10/14] drm/i915/gem: Check that the context wasn't closed during setup Chris Wilson
2020-02-24 10:00 ` [Intel-gfx] [PATCH 11/14] drm/i915/gt: Declare when we enabled timeslicing Chris Wilson
2020-02-24 10:00 ` [Intel-gfx] [PATCH 12/14] drm/i915/gt: Yield the timeslice if caught waiting on a user semaphore Chris Wilson
2020-02-24 10:00 ` [Intel-gfx] [PATCH 13/14] drm/i915/execlists: Check the sentinel is alone in the ELSP Chris Wilson
2020-02-24 10:00 ` [Intel-gfx] [PATCH 14/14] drm/i915/execlists: Reduce preempt-to-busy roundtrip delay Chris Wilson
2020-02-24 10:59 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/14] drm/i915/selftests: Verify LRC isolation Patchwork
2020-02-24 13:17 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200224100007.4024184-9-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.