Re: [PATCH] drm/i915/selftests: Release ctx->engine_mutex after iteration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxxxxxxxxx>
Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>
Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
---
  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@xxxxxxxxx>

Regards,

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




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux