From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Matthew Auld <matthew.auld@intel.com>
Subject: Re: [PATCH] drm/i915/selftests: Release ctx->engine_mutex after iteration
Date: Wed, 23 Oct 2019 10:03:25 +0100 [thread overview]
Message-ID: <1d6dd372-ae0b-7b1a-c248-58fcc0d33700@linux.intel.com> (raw)
In-Reply-To: <20191022223316.12662-1-chris@chris-wilson.co.uk>
On 22/10/2019 23:33, Chris Wilson wrote:
> A lock once taken must be released again.
>
> Fixes: c31c9e82ee8a ("drm/i915/selftests: Teach switch_to_context() to use the context")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> ---
> drivers/gpu/drm/i915/selftests/i915_gem.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem.c b/drivers/gpu/drm/i915/selftests/i915_gem.c
> index 84e7ca778b7b..6d22567ad620 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem.c
> @@ -19,18 +19,22 @@ static int switch_to_context(struct i915_gem_context *ctx)
> {
> struct i915_gem_engines_iter it;
> struct intel_context *ce;
> + int err = 0;
>
> for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) {
> struct i915_request *rq;
>
> rq = intel_context_create_request(ce);
> - if (IS_ERR(rq))
> - return PTR_ERR(rq);
> + if (IS_ERR(rq)) {
> + err = PTR_ERR(rq);
> + break;
> + }
>
> i915_request_add(rq);
> }
> + i915_gem_context_unlock_engines(ctx);
>
> - return 0;
> + return err;
> }
>
> static void trash_stolen(struct drm_i915_private *i915)
>
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:[~2019-10-23 9:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-22 22:33 [PATCH] drm/i915/selftests: Release ctx->engine_mutex after iteration Chris Wilson
2019-10-23 1:47 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-10-23 9:03 ` Tvrtko Ursulin [this message]
2019-10-23 16:20 ` ✓ Fi.CI.IGT: " Patchwork
2019-10-23 16:20 ` [Intel-gfx] " 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=1d6dd372-ae0b-7b1a-c248-58fcc0d33700@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox