[01/10] drm/i915/selftests: Disable preemptive heartbeats over preemption tests
diff mbox series

Message ID 20200615123920.17749-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [01/10] drm/i915/selftests: Disable preemptive heartbeats over preemption tests
Related show

Commit Message

Chris Wilson June 15, 2020, 12:39 p.m. UTC
Since the heartbeat may cause a preemption event, disable it over the
preemption suppression tests.

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

Comments

Mika Kuoppala June 15, 2020, 3:29 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Since the heartbeat may cause a preemption event, disable it over the
> preemption suppression tests.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

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

> ---
>  drivers/gpu/drm/i915/gt/selftest_lrc.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> index f651bdf7f191..91543494f595 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> @@ -2282,7 +2282,7 @@ static int live_suppress_self_preempt(void *arg)
>  		if (igt_flush_test(gt->i915))
>  			goto err_wedged;
>  
> -		intel_engine_pm_get(engine);
> +		engine_heartbeat_disable(engine);
>  		engine->execlists.preempt_hang.count = 0;
>  
>  		rq_a = spinner_create_request(&a.spin,
> @@ -2290,14 +2290,14 @@ static int live_suppress_self_preempt(void *arg)
>  					      MI_NOOP);
>  		if (IS_ERR(rq_a)) {
>  			err = PTR_ERR(rq_a);
> -			intel_engine_pm_put(engine);
> +			engine_heartbeat_enable(engine);
>  			goto err_client_b;
>  		}
>  
>  		i915_request_add(rq_a);
>  		if (!igt_wait_for_spinner(&a.spin, rq_a)) {
>  			pr_err("First client failed to start\n");
> -			intel_engine_pm_put(engine);
> +			engine_heartbeat_enable(engine);
>  			goto err_wedged;
>  		}
>  
> @@ -2309,7 +2309,7 @@ static int live_suppress_self_preempt(void *arg)
>  						      MI_NOOP);
>  			if (IS_ERR(rq_b)) {
>  				err = PTR_ERR(rq_b);
> -				intel_engine_pm_put(engine);
> +				engine_heartbeat_enable(engine);
>  				goto err_client_b;
>  			}
>  			i915_request_add(rq_b);
> @@ -2320,7 +2320,7 @@ static int live_suppress_self_preempt(void *arg)
>  
>  			if (!igt_wait_for_spinner(&b.spin, rq_b)) {
>  				pr_err("Second client failed to start\n");
> -				intel_engine_pm_put(engine);
> +				engine_heartbeat_enable(engine);
>  				goto err_wedged;
>  			}
>  
> @@ -2334,12 +2334,12 @@ static int live_suppress_self_preempt(void *arg)
>  			       engine->name,
>  			       engine->execlists.preempt_hang.count,
>  			       depth);
> -			intel_engine_pm_put(engine);
> +			engine_heartbeat_enable(engine);
>  			err = -EINVAL;
>  			goto err_client_b;
>  		}
>  
> -		intel_engine_pm_put(engine);
> +		engine_heartbeat_enable(engine);
>  		if (igt_flush_test(gt->i915))
>  			goto err_wedged;
>  	}
> -- 
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index f651bdf7f191..91543494f595 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -2282,7 +2282,7 @@  static int live_suppress_self_preempt(void *arg)
 		if (igt_flush_test(gt->i915))
 			goto err_wedged;
 
-		intel_engine_pm_get(engine);
+		engine_heartbeat_disable(engine);
 		engine->execlists.preempt_hang.count = 0;
 
 		rq_a = spinner_create_request(&a.spin,
@@ -2290,14 +2290,14 @@  static int live_suppress_self_preempt(void *arg)
 					      MI_NOOP);
 		if (IS_ERR(rq_a)) {
 			err = PTR_ERR(rq_a);
-			intel_engine_pm_put(engine);
+			engine_heartbeat_enable(engine);
 			goto err_client_b;
 		}
 
 		i915_request_add(rq_a);
 		if (!igt_wait_for_spinner(&a.spin, rq_a)) {
 			pr_err("First client failed to start\n");
-			intel_engine_pm_put(engine);
+			engine_heartbeat_enable(engine);
 			goto err_wedged;
 		}
 
@@ -2309,7 +2309,7 @@  static int live_suppress_self_preempt(void *arg)
 						      MI_NOOP);
 			if (IS_ERR(rq_b)) {
 				err = PTR_ERR(rq_b);
-				intel_engine_pm_put(engine);
+				engine_heartbeat_enable(engine);
 				goto err_client_b;
 			}
 			i915_request_add(rq_b);
@@ -2320,7 +2320,7 @@  static int live_suppress_self_preempt(void *arg)
 
 			if (!igt_wait_for_spinner(&b.spin, rq_b)) {
 				pr_err("Second client failed to start\n");
-				intel_engine_pm_put(engine);
+				engine_heartbeat_enable(engine);
 				goto err_wedged;
 			}
 
@@ -2334,12 +2334,12 @@  static int live_suppress_self_preempt(void *arg)
 			       engine->name,
 			       engine->execlists.preempt_hang.count,
 			       depth);
-			intel_engine_pm_put(engine);
+			engine_heartbeat_enable(engine);
 			err = -EINVAL;
 			goto err_client_b;
 		}
 
-		intel_engine_pm_put(engine);
+		engine_heartbeat_enable(engine);
 		if (igt_flush_test(gt->i915))
 			goto err_wedged;
 	}