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: mika.kuoppala@intel.com
Subject: [PATCH 5/7] drm/i915: Wait for old resets before applying debugfs/i915_wedged
Date: Wed,  6 Feb 2019 12:04:30 +0000	[thread overview]
Message-ID: <20190206120432.9452-5-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20190206120432.9452-1-chris@chris-wilson.co.uk>

Since we use the debugfs to recover the device after modifying the
i915.reset parameter, we need to be sure that we apply the reset and not
piggy-back onto a concurrent one in order for the parameter to take
effect.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index a6fd157b1637..8a488ffc8b7d 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3874,13 +3874,9 @@ i915_wedged_set(void *data, u64 val)
 {
 	struct drm_i915_private *i915 = data;
 
-	/*
-	 * There is no safeguard against this debugfs entry colliding
-	 * with the hangcheck calling same i915_handle_error() in
-	 * parallel, causing an explosion. For now we assume that the
-	 * test harness is responsible enough not to inject gpu hangs
-	 * while it is writing to 'i915_wedged'
-	 */
+	/* Flush any previous reset before applying for a new one */
+	wait_event(i915->gpu_error.reset_queue,
+		   !test_bit(I915_RESET_BACKOFF, &i915->gpu_error.flags));
 
 	i915_handle_error(i915, val, I915_ERROR_CAPTURE,
 			  "Manually set wedged engine mask = %llx", val);
-- 
2.20.1

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

  parent reply	other threads:[~2019-02-06 12:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 12:04 [PATCH 1/7] drm/i915: Hack and slash, throttle execbuffer hogs Chris Wilson
2019-02-06 12:04 ` [PATCH 2/7] drm/i915: Revoke mmaps and prevent access to fence registers across reset Chris Wilson
2019-02-06 12:04 ` [PATCH 3/7] drm/i915: Force the GPU reset upon wedging Chris Wilson
2019-02-06 12:04 ` [PATCH 4/7] drm/i915: Uninterruptibly drain the timelines on unwedging Chris Wilson
2019-02-06 12:04 ` Chris Wilson [this message]
2019-02-06 12:04 ` [PATCH 6/7] drm/i915: Serialise resets with wedging Chris Wilson
2019-02-06 12:04 ` [PATCH 7/7] drm/i915: Don't claim an unstarted request was guilty Chris Wilson
2019-02-06 12:45 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/7] drm/i915: Hack and slash, throttle execbuffer hogs Patchwork
2019-02-06 13:28 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-06 15:02 ` ✓ Fi.CI.IGT: " Patchwork
2019-02-06 15:08   ` Chris Wilson

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=20190206120432.9452-5-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@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.