From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Order two completing nop_submit_request
Date: Fri, 6 Oct 2017 13:23:03 +0100 [thread overview]
Message-ID: <ebfddc6b-5035-e59d-a2da-d88fff63f9c7@linux.intel.com> (raw)
In-Reply-To: <20171006115617.18432-1-chris@chris-wilson.co.uk>
On 06/10/2017 12:56, Chris Wilson wrote:
> If two nop's (requests in-flight following a wedged device) complete at
> the same time, the global_seqno value written to the HWSP is undefined
> as the two threads are not serialized.
>
> v2: Use irqsafe spinlock. We expect the callback may be called from
> inside another irq spinlock, so we can't unconditionally restore irqs.
>
> Fixes: ce1135c7de64 ("drm/i915: Complete requests in nop_submit_request")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> #v1
> ---
> drivers/gpu/drm/i915/i915_gem.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index ab8c6946fea4..6a6974ed8f74 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3014,10 +3014,15 @@ void i915_gem_reset_finish(struct drm_i915_private *dev_priv)
>
> static void nop_submit_request(struct drm_i915_gem_request *request)
> {
> + unsigned long flags;
> +
> GEM_BUG_ON(!i915_terminally_wedged(&request->i915->gpu_error));
> dma_fence_set_error(&request->fence, -EIO);
> - i915_gem_request_submit(request);
> +
> + spin_lock_irqsave(&request->engine->timeline->lock, flags);
> + __i915_gem_request_submit(request);
> intel_engine_init_global_seqno(request->engine, request->global_seqno);
> + spin_unlock_irqrestore(&request->engine->timeline->lock, flags);
> }
>
> static void engine_set_wedged(struct intel_engine_cs *engine)
>
Ooops..
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-10-06 12:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 11:22 [PATCH] drm/i915: Order two completing nop_submit_request Chris Wilson
2017-10-06 11:42 ` Tvrtko Ursulin
2017-10-06 11:53 ` Chris Wilson
2017-10-06 11:56 ` [PATCH v2] " Chris Wilson
2017-10-06 12:23 ` Tvrtko Ursulin [this message]
2017-10-06 17:25 ` Chris Wilson
2017-10-06 13:51 ` ✓ Fi.CI.BAT: success for drm/i915: Order two completing nop_submit_request (rev2) Patchwork
2017-10-06 17:08 ` ✗ Fi.CI.IGT: warning " 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=ebfddc6b-5035-e59d-a2da-d88fff63f9c7@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox