All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/selftests: Disable heartbeat around hang tests
@ 2020-01-31 13:03 Chris Wilson
  2020-01-31 13:22 ` Mika Kuoppala
  2020-01-31 19:09 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2020-01-31 13:03 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

If the heartbeat fires in the middle of the preempt-hang test, it
consumes our forced hang disrupting the test.

Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/selftest_lrc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index 5e04ecb61dcc..f5214a374fb7 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -2452,15 +2452,19 @@ static int live_preempt_hang(void *arg)
 		I915_USER_PRIORITY(I915_CONTEXT_MIN_USER_PRIORITY);
 
 	for_each_engine(engine, gt, id) {
+		unsigned long heartbeat;
 		struct i915_request *rq;
 
 		if (!intel_engine_has_preemption(engine))
 			continue;
 
+		engine_heartbeat_disable(engine, &heartbeat);
+
 		rq = spinner_create_request(&spin_lo, ctx_lo, engine,
 					    MI_ARB_CHECK);
 		if (IS_ERR(rq)) {
 			err = PTR_ERR(rq);
+			engine_heartbeat_enable(engine, heartbeat);
 			goto err_ctx_lo;
 		}
 
@@ -2470,6 +2474,7 @@ static int live_preempt_hang(void *arg)
 			GEM_TRACE_DUMP();
 			intel_gt_set_wedged(gt);
 			err = -EIO;
+			engine_heartbeat_enable(engine, heartbeat);
 			goto err_ctx_lo;
 		}
 
@@ -2477,6 +2482,7 @@ static int live_preempt_hang(void *arg)
 					    MI_ARB_CHECK);
 		if (IS_ERR(rq)) {
 			igt_spinner_end(&spin_lo);
+			engine_heartbeat_enable(engine, heartbeat);
 			err = PTR_ERR(rq);
 			goto err_ctx_lo;
 		}
@@ -2491,6 +2497,7 @@ static int live_preempt_hang(void *arg)
 			pr_err("Preemption did not occur within timeout!");
 			GEM_TRACE_DUMP();
 			intel_gt_set_wedged(gt);
+			engine_heartbeat_enable(engine, heartbeat);
 			err = -EIO;
 			goto err_ctx_lo;
 		}
@@ -2505,12 +2512,15 @@ static int live_preempt_hang(void *arg)
 			GEM_TRACE("hi spinner failed to start\n");
 			GEM_TRACE_DUMP();
 			intel_gt_set_wedged(gt);
+			engine_heartbeat_enable(engine, heartbeat);
 			err = -EIO;
 			goto err_ctx_lo;
 		}
 
 		igt_spinner_end(&spin_hi);
 		igt_spinner_end(&spin_lo);
+		engine_heartbeat_enable(engine, heartbeat);
+
 		if (igt_flush_test(gt->i915)) {
 			err = -EIO;
 			goto err_ctx_lo;
-- 
2.25.0

_______________________________________________
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

* Re: [Intel-gfx] [PATCH] drm/i915/selftests: Disable heartbeat around hang tests
  2020-01-31 13:03 [Intel-gfx] [PATCH] drm/i915/selftests: Disable heartbeat around hang tests Chris Wilson
@ 2020-01-31 13:22 ` Mika Kuoppala
  2020-01-31 13:31   ` Chris Wilson
  2020-01-31 19:09 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
  1 sibling, 1 reply; 4+ messages in thread
From: Mika Kuoppala @ 2020-01-31 13:22 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Daniel Vetter

Chris Wilson <chris@chris-wilson.co.uk> writes:

> If the heartbeat fires in the middle of the preempt-hang test, it
> consumes our forced hang disrupting the test.
>
> Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/gt/selftest_lrc.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> index 5e04ecb61dcc..f5214a374fb7 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> @@ -2452,15 +2452,19 @@ static int live_preempt_hang(void *arg)
>  		I915_USER_PRIORITY(I915_CONTEXT_MIN_USER_PRIORITY);
>  
>  	for_each_engine(engine, gt, id) {
> +		unsigned long heartbeat;
>  		struct i915_request *rq;
>  
>  		if (!intel_engine_has_preemption(engine))
>  			continue;
>  
> +		engine_heartbeat_disable(engine, &heartbeat);
> +
>  		rq = spinner_create_request(&spin_lo, ctx_lo, engine,
>  					    MI_ARB_CHECK);
>  		if (IS_ERR(rq)) {
>  			err = PTR_ERR(rq);
> +			engine_heartbeat_enable(engine, heartbeat);

Was thinking that you could grab the engine and abuse then the error
path to enable.

But too hairy.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

>  			goto err_ctx_lo;
>  		}
>  
> @@ -2470,6 +2474,7 @@ static int live_preempt_hang(void *arg)
>  			GEM_TRACE_DUMP();
>  			intel_gt_set_wedged(gt);
>  			err = -EIO;
> +			engine_heartbeat_enable(engine, heartbeat);
>  			goto err_ctx_lo;
>  		}
>  
> @@ -2477,6 +2482,7 @@ static int live_preempt_hang(void *arg)
>  					    MI_ARB_CHECK);
>  		if (IS_ERR(rq)) {
>  			igt_spinner_end(&spin_lo);
> +			engine_heartbeat_enable(engine, heartbeat);
>  			err = PTR_ERR(rq);
>  			goto err_ctx_lo;
>  		}
> @@ -2491,6 +2497,7 @@ static int live_preempt_hang(void *arg)
>  			pr_err("Preemption did not occur within timeout!");
>  			GEM_TRACE_DUMP();
>  			intel_gt_set_wedged(gt);
> +			engine_heartbeat_enable(engine, heartbeat);
>  			err = -EIO;
>  			goto err_ctx_lo;
>  		}
> @@ -2505,12 +2512,15 @@ static int live_preempt_hang(void *arg)
>  			GEM_TRACE("hi spinner failed to start\n");
>  			GEM_TRACE_DUMP();
>  			intel_gt_set_wedged(gt);
> +			engine_heartbeat_enable(engine, heartbeat);
>  			err = -EIO;
>  			goto err_ctx_lo;
>  		}
>  
>  		igt_spinner_end(&spin_hi);
>  		igt_spinner_end(&spin_lo);
> +		engine_heartbeat_enable(engine, heartbeat);
> +
>  		if (igt_flush_test(gt->i915)) {
>  			err = -EIO;
>  			goto err_ctx_lo;
> -- 
> 2.25.0
>
> _______________________________________________
> 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: [Intel-gfx] [PATCH] drm/i915/selftests: Disable heartbeat around hang tests
  2020-01-31 13:22 ` Mika Kuoppala
@ 2020-01-31 13:31   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2020-01-31 13:31 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx; +Cc: Daniel Vetter

Quoting Mika Kuoppala (2020-01-31 13:22:38)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > If the heartbeat fires in the middle of the preempt-hang test, it
> > consumes our forced hang disrupting the test.
> >
> > Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/gt/selftest_lrc.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> > index 5e04ecb61dcc..f5214a374fb7 100644
> > --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
> > +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> > @@ -2452,15 +2452,19 @@ static int live_preempt_hang(void *arg)
> >               I915_USER_PRIORITY(I915_CONTEXT_MIN_USER_PRIORITY);
> >  
> >       for_each_engine(engine, gt, id) {
> > +             unsigned long heartbeat;
> >               struct i915_request *rq;
> >  
> >               if (!intel_engine_has_preemption(engine))
> >                       continue;
> >  
> > +             engine_heartbeat_disable(engine, &heartbeat);
> > +
> >               rq = spinner_create_request(&spin_lo, ctx_lo, engine,
> >                                           MI_ARB_CHECK);
> >               if (IS_ERR(rq)) {
> >                       err = PTR_ERR(rq);
> > +                     engine_heartbeat_enable(engine, heartbeat);
> 
> Was thinking that you could grab the engine and abuse then the error
> path to enable.
> 
> But too hairy.

Yeah, we've done staggered error paths, but both look ugly, So I took
the easy approach. Move the inner loop to its own test function usually
helps though.
-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

* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/selftests: Disable heartbeat around hang tests
  2020-01-31 13:03 [Intel-gfx] [PATCH] drm/i915/selftests: Disable heartbeat around hang tests Chris Wilson
  2020-01-31 13:22 ` Mika Kuoppala
@ 2020-01-31 19:09 ` Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2020-01-31 19:09 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Disable heartbeat around hang tests
URL   : https://patchwork.freedesktop.org/series/72821/
State : failure

== Summary ==

Applying: drm/i915/selftests: Disable heartbeat around hang tests
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/i915/gt/selftest_lrc.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/gt/selftest_lrc.c
No changes -- Patch already applied.

_______________________________________________
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:[~2020-01-31 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31 13:03 [Intel-gfx] [PATCH] drm/i915/selftests: Disable heartbeat around hang tests Chris Wilson
2020-01-31 13:22 ` Mika Kuoppala
2020-01-31 13:31   ` Chris Wilson
2020-01-31 19:09 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork

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.