All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [RESEND 4/6] drm/i915/execlists: Disable submission tasklet upon wedging
Date: Mon, 16 Jul 2018 08:22:17 +0100	[thread overview]
Message-ID: <20180716072219.31609-4-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20180716072219.31609-1-chris@chris-wilson.co.uk>

If we declare the driver wedged before the GPU truly is, then we may see
the GPU complete some CS events following our cancellation. This leaves
us quite confused as we deleted all the bookkeeping and thus complain
about the inconsistent state.

We can just ignore the remaining events and let the GPU idle by not
feeding it, and so avoid trying to racily overwrite shared state. We
rely on there being a full GPU reset before unwedging, giving us the
opportunity to reset the shared state.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_lrc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 4ef4439ff438..2c0050bab71e 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -811,6 +811,11 @@ static void reset_csb_pointers(struct intel_engine_execlists *execlists)
 	WRITE_ONCE(*execlists->csb_write, execlists->csb_write_reset);
 }
 
+static void nop_submission_tasklet(unsigned long data)
+{
+	/* The driver is wedged; don't process any more events. */
+}
+
 static void execlists_cancel_requests(struct intel_engine_cs *engine)
 {
 	struct intel_engine_execlists * const execlists = &engine->execlists;
@@ -871,6 +876,9 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)
 	execlists->queue = RB_ROOT_CACHED;
 	GEM_BUG_ON(port_isset(execlists->port));
 
+	GEM_BUG_ON(__tasklet_is_enabled(&execlists->tasklet));
+	execlists->tasklet.func = nop_submission_tasklet;
+
 	spin_unlock_irqrestore(&engine->timeline.lock, flags);
 }
 
-- 
2.18.0

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

  parent reply	other threads:[~2018-07-16  7:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16  7:22 [RESEND 1/6] drm/i915/selftests: Force a preemption hang Chris Wilson
2018-07-16  7:22 ` [RESEND 2/6] drm/i915/selftests: Exercise reset to break stuck GTT eviction Chris Wilson
2018-07-16  7:22 ` [RESEND 3/6] drm/i915/execlists: Always clear preempt status on cancelling all Chris Wilson
2018-07-16  7:22 ` Chris Wilson [this message]
2018-07-16  7:22 ` [RESEND 5/6] drm/i915: Remove pci private pointer after destroying the device private Chris Wilson
2018-07-16  7:22 ` [RESEND 6/6] drm/i915/selftests: Downgrade igt_timeout message Chris Wilson
2018-07-16  8:57 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [RESEND,1/6] drm/i915/selftests: Force a preemption hang Patchwork
2018-07-16  9:18 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-16 15:52 ` ✓ Fi.CI.IGT: " Patchwork
2018-07-16  8:03 [RESEND 1/6] " Chris Wilson
2018-07-16  8:03 ` [RESEND 4/6] drm/i915/execlists: Disable submission tasklet upon wedging Chris Wilson
2018-07-16  9:59   ` Tvrtko Ursulin

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=20180716072219.31609-4-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.