Commit 0b8d6273 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Keep the engine awake while we keep for preemption

Keep the engine awake to ensure that we don't inject any pm-idle
requests.

References: https://bugs.freedesktop.org/show_bug.cgi?id=111108Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Acked-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190912122639.25224-1-chris@chris-wilson.co.uk
parent 0c653722
...@@ -897,6 +897,10 @@ static int live_suppress_self_preempt(void *arg) ...@@ -897,6 +897,10 @@ static int live_suppress_self_preempt(void *arg)
if (!intel_engine_has_preemption(engine)) if (!intel_engine_has_preemption(engine))
continue; continue;
if (igt_flush_test(i915, I915_WAIT_LOCKED))
goto err_wedged;
intel_engine_pm_get(engine);
engine->execlists.preempt_hang.count = 0; engine->execlists.preempt_hang.count = 0;
rq_a = spinner_create_request(&a.spin, rq_a = spinner_create_request(&a.spin,
...@@ -904,12 +908,14 @@ static int live_suppress_self_preempt(void *arg) ...@@ -904,12 +908,14 @@ static int live_suppress_self_preempt(void *arg)
MI_NOOP); MI_NOOP);
if (IS_ERR(rq_a)) { if (IS_ERR(rq_a)) {
err = PTR_ERR(rq_a); err = PTR_ERR(rq_a);
intel_engine_pm_put(engine);
goto err_client_b; goto err_client_b;
} }
i915_request_add(rq_a); i915_request_add(rq_a);
if (!igt_wait_for_spinner(&a.spin, rq_a)) { if (!igt_wait_for_spinner(&a.spin, rq_a)) {
pr_err("First client failed to start\n"); pr_err("First client failed to start\n");
intel_engine_pm_put(engine);
goto err_wedged; goto err_wedged;
} }
...@@ -921,6 +927,7 @@ static int live_suppress_self_preempt(void *arg) ...@@ -921,6 +927,7 @@ static int live_suppress_self_preempt(void *arg)
MI_NOOP); MI_NOOP);
if (IS_ERR(rq_b)) { if (IS_ERR(rq_b)) {
err = PTR_ERR(rq_b); err = PTR_ERR(rq_b);
intel_engine_pm_put(engine);
goto err_client_b; goto err_client_b;
} }
i915_request_add(rq_b); i915_request_add(rq_b);
...@@ -931,6 +938,7 @@ static int live_suppress_self_preempt(void *arg) ...@@ -931,6 +938,7 @@ static int live_suppress_self_preempt(void *arg)
if (!igt_wait_for_spinner(&b.spin, rq_b)) { if (!igt_wait_for_spinner(&b.spin, rq_b)) {
pr_err("Second client failed to start\n"); pr_err("Second client failed to start\n");
intel_engine_pm_put(engine);
goto err_wedged; goto err_wedged;
} }
...@@ -944,10 +952,12 @@ static int live_suppress_self_preempt(void *arg) ...@@ -944,10 +952,12 @@ static int live_suppress_self_preempt(void *arg)
engine->name, engine->name,
engine->execlists.preempt_hang.count, engine->execlists.preempt_hang.count,
depth); depth);
intel_engine_pm_put(engine);
err = -EINVAL; err = -EINVAL;
goto err_client_b; goto err_client_b;
} }
intel_engine_pm_put(engine);
if (igt_flush_test(i915, I915_WAIT_LOCKED)) if (igt_flush_test(i915, I915_WAIT_LOCKED))
goto err_wedged; goto err_wedged;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment