All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback
@ 2017-06-23 13:19 Chris Wilson
  2017-06-23 13:39 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-06-23 17:14 ` [PATCH] " Michel Thierry
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-06-23 13:19 UTC (permalink / raw)
  To: intel-gfx

Smatch spots:

drivers/gpu/drm/i915/selftests/intel_hangcheck.c:669 igt_render_engine_reset_fallback() error: double unlock 'mutex:&i915->drm.struct_mutex'

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

diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
index af475189bd52..7096c3911cd3 100644
--- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
+++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
@@ -597,12 +597,12 @@ static int igt_render_engine_reset_fallback(void *arg)
 
 	err = hang_init(&h, i915);
 	if (err)
-		goto unlock;
+		goto err_unlock;
 
 	rq = hang_create_request(&h, engine, i915->kernel_context);
 	if (IS_ERR(rq)) {
 		err = PTR_ERR(rq);
-		goto fini;
+		goto err_fini;
 	}
 
 	i915_gem_request_get(rq);
@@ -614,7 +614,7 @@ static int igt_render_engine_reset_fallback(void *arg)
 	if (!wait_for_hang(&h, rq)) {
 		pr_err("Failed to start request %x\n", rq->fence.seqno);
 		err = -EIO;
-		goto out_rq;
+		goto err_request;
 	}
 
 	reset_engine_count = i915_reset_engine_count(&i915->gpu_error, engine);
@@ -646,13 +646,14 @@ static int igt_render_engine_reset_fallback(void *arg)
 	 */
 	if (i915_terminally_wedged(&i915->gpu_error)) {
 		set_bit(I915_RESET_BACKOFF, &i915->gpu_error.flags);
-		mutex_lock(&i915->drm.struct_mutex);
 		rq->fence.error = 0;
 
+		mutex_lock(&i915->drm.struct_mutex);
 		set_bit(I915_RESET_HANDOFF, &i915->gpu_error.flags);
 		i915_reset(i915);
 		GEM_BUG_ON(test_bit(I915_RESET_HANDOFF,
 				    &i915->gpu_error.flags));
+		mutex_unlock(&i915->drm.struct_mutex);
 
 		if (i915_reset_count(&i915->gpu_error) == reset_count) {
 			pr_err("No full GPU reset recorded!\n");
@@ -663,10 +664,8 @@ static int igt_render_engine_reset_fallback(void *arg)
 
 out_rq:
 	i915_gem_request_put(rq);
-fini:
 	hang_fini(&h);
-unlock:
-	mutex_unlock(&i915->drm.struct_mutex);
+out_backoff:
 	clear_bit(I915_RESET_BACKOFF, &i915->gpu_error.flags);
 	wake_up_all(&i915->gpu_error.reset_queue);
 
@@ -674,6 +673,14 @@ static int igt_render_engine_reset_fallback(void *arg)
 		return -EIO;
 
 	return err;
+
+err_request:
+	i915_gem_request_put(rq);
+err_fini:
+	hang_fini(&h);
+err_unlock:
+	mutex_unlock(&i915->drm.struct_mutex);
+	goto out_backoff;
 }
 
 int intel_hangcheck_live_selftests(struct drm_i915_private *i915)
-- 
2.13.1

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback
  2017-06-23 13:19 [PATCH] drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback Chris Wilson
@ 2017-06-23 13:39 ` Patchwork
  2017-06-27 13:25   ` Chris Wilson
  2017-06-23 17:14 ` [PATCH] " Michel Thierry
  1 sibling, 1 reply; 4+ messages in thread
From: Patchwork @ 2017-06-23 13:39 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback
URL   : https://patchwork.freedesktop.org/series/26288/
State : success

== Summary ==

Series 26288v1 drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback
https://patchwork.freedesktop.org/api/1.0/series/26288/revisions/1/mbox/

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                fail       -> PASS       (fi-snb-2600) fdo#100215

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:454s
fi-bdw-gvtdvm    total:279  pass:257  dwarn:8   dfail:0   fail:0   skip:14  time:434s
fi-bsw-n3050     total:279  pass:242  dwarn:1   dfail:0   fail:0   skip:36  time:532s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:515s
fi-byt-j1900     total:279  pass:253  dwarn:2   dfail:0   fail:0   skip:24  time:493s
fi-byt-n2820     total:279  pass:249  dwarn:2   dfail:0   fail:0   skip:28  time:485s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:589s
fi-hsw-4770      total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:433s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:419s
fi-ilk-650       total:279  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:419s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:505s
fi-ivb-3770      total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:475s
fi-kbl-7500u     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:463s
fi-kbl-7560u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:570s
fi-kbl-r         total:279  pass:260  dwarn:1   dfail:0   fail:0   skip:18  time:581s
fi-skl-6260u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:455s
fi-skl-6700hq    total:279  pass:223  dwarn:1   dfail:0   fail:30  skip:24  time:346s
fi-skl-6700k     total:279  pass:257  dwarn:4   dfail:0   fail:0   skip:18  time:468s
fi-skl-6770hq    total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:474s
fi-skl-gvtdvm    total:279  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:434s
fi-snb-2520m     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:538s
fi-snb-2600      total:279  pass:250  dwarn:0   dfail:0   fail:0   skip:29  time:402s

1789a777702e41b11133dd23578edbd0b47ccf40 drm-tip: 2017y-06m-23d-12h-42m-45s UTC integration manifest
e19b54c drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_5034/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback
  2017-06-23 13:19 [PATCH] drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback Chris Wilson
  2017-06-23 13:39 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-06-23 17:14 ` Michel Thierry
  1 sibling, 0 replies; 4+ messages in thread
From: Michel Thierry @ 2017-06-23 17:14 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On 23/06/17 06:19, Chris Wilson wrote:
> Smatch spots:
>
> drivers/gpu/drm/i915/selftests/intel_hangcheck.c:669 igt_render_engine_reset_fallback() error: double unlock 'mutex:&i915->drm.struct_mutex'
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Michel Thierry <michel.thierry@intel.com>

> ---
>  drivers/gpu/drm/i915/selftests/intel_hangcheck.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> index af475189bd52..7096c3911cd3 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> @@ -597,12 +597,12 @@ static int igt_render_engine_reset_fallback(void *arg)
>
>         err = hang_init(&h, i915);
>         if (err)
> -               goto unlock;
> +               goto err_unlock;
>
>         rq = hang_create_request(&h, engine, i915->kernel_context);
>         if (IS_ERR(rq)) {
>                 err = PTR_ERR(rq);
> -               goto fini;
> +               goto err_fini;
>         }
>
>         i915_gem_request_get(rq);
> @@ -614,7 +614,7 @@ static int igt_render_engine_reset_fallback(void *arg)
>         if (!wait_for_hang(&h, rq)) {
>                 pr_err("Failed to start request %x\n", rq->fence.seqno);
>                 err = -EIO;
> -               goto out_rq;
> +               goto err_request;
>         }
>
>         reset_engine_count = i915_reset_engine_count(&i915->gpu_error, engine);
> @@ -646,13 +646,14 @@ static int igt_render_engine_reset_fallback(void *arg)
>          */
>         if (i915_terminally_wedged(&i915->gpu_error)) {
>                 set_bit(I915_RESET_BACKOFF, &i915->gpu_error.flags);
> -               mutex_lock(&i915->drm.struct_mutex);
>                 rq->fence.error = 0;
>
> +               mutex_lock(&i915->drm.struct_mutex);
>                 set_bit(I915_RESET_HANDOFF, &i915->gpu_error.flags);
>                 i915_reset(i915);
>                 GEM_BUG_ON(test_bit(I915_RESET_HANDOFF,
>                                     &i915->gpu_error.flags));
> +               mutex_unlock(&i915->drm.struct_mutex);
>
>                 if (i915_reset_count(&i915->gpu_error) == reset_count) {
>                         pr_err("No full GPU reset recorded!\n");
> @@ -663,10 +664,8 @@ static int igt_render_engine_reset_fallback(void *arg)
>
>  out_rq:
>         i915_gem_request_put(rq);
> -fini:
>         hang_fini(&h);
> -unlock:
> -       mutex_unlock(&i915->drm.struct_mutex);
> +out_backoff:
>         clear_bit(I915_RESET_BACKOFF, &i915->gpu_error.flags);
>         wake_up_all(&i915->gpu_error.reset_queue);
>
> @@ -674,6 +673,14 @@ static int igt_render_engine_reset_fallback(void *arg)
>                 return -EIO;
>
>         return err;
> +
> +err_request:
> +       i915_gem_request_put(rq);
> +err_fini:
> +       hang_fini(&h);
> +err_unlock:
> +       mutex_unlock(&i915->drm.struct_mutex);
> +       goto out_backoff;
>  }
>
>  int intel_hangcheck_live_selftests(struct drm_i915_private *i915)
> --
> 2.13.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ✓ Fi.CI.BAT: success for drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback
  2017-06-23 13:39 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-06-27 13:25   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-06-27 13:25 UTC (permalink / raw)
  To: Patchwork; +Cc: intel-gfx

Quoting Patchwork (2017-06-23 14:39:08)
> == Series Details ==
> 
> Series: drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback
> URL   : https://patchwork.freedesktop.org/series/26288/
> State : success
> 
> == Summary ==
> 
> Series 26288v1 drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback
> https://patchwork.freedesktop.org/api/1.0/series/26288/revisions/1/mbox/
> 
> Test kms_cursor_legacy:
>         Subgroup basic-busy-flip-before-cursor-legacy:
>                 fail       -> PASS       (fi-snb-2600) fdo#100215
> 
> fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215

One day, they may be included in BAT!

Thanks for the review, sorry for my mess, pushed.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-27 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23 13:19 [PATCH] drm/i915/selftests: Fix mutex imbalance for igt_render_engine_reset_fallback Chris Wilson
2017-06-23 13:39 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-06-27 13:25   ` Chris Wilson
2017-06-23 17:14 ` [PATCH] " Michel Thierry

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.