Commit 950da301 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Disable heartbeat around manual pulse tests

Still chasing the mystery of the stray idle flush, let's ensure that the
heartbeat does not run at the same time as our test and confuse us.

References: https://gitlab.freedesktop.org/drm/intel/issues/541Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarAndi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227085723.1961649-8-chris@chris-wilson.co.uk
parent c0e31018
...@@ -142,6 +142,24 @@ static int __live_idle_pulse(struct intel_engine_cs *engine, ...@@ -142,6 +142,24 @@ static int __live_idle_pulse(struct intel_engine_cs *engine,
return err; return err;
} }
static void engine_heartbeat_disable(struct intel_engine_cs *engine,
unsigned long *saved)
{
*saved = engine->props.heartbeat_interval_ms;
engine->props.heartbeat_interval_ms = 0;
intel_engine_pm_get(engine);
intel_engine_park_heartbeat(engine);
}
static void engine_heartbeat_enable(struct intel_engine_cs *engine,
unsigned long saved)
{
intel_engine_pm_put(engine);
engine->props.heartbeat_interval_ms = saved;
}
static int live_idle_flush(void *arg) static int live_idle_flush(void *arg)
{ {
struct intel_gt *gt = arg; struct intel_gt *gt = arg;
...@@ -152,9 +170,11 @@ static int live_idle_flush(void *arg) ...@@ -152,9 +170,11 @@ static int live_idle_flush(void *arg)
/* Check that we can flush the idle barriers */ /* Check that we can flush the idle barriers */
for_each_engine(engine, gt, id) { for_each_engine(engine, gt, id) {
intel_engine_pm_get(engine); unsigned long heartbeat;
engine_heartbeat_disable(engine, &heartbeat);
err = __live_idle_pulse(engine, intel_engine_flush_barriers); err = __live_idle_pulse(engine, intel_engine_flush_barriers);
intel_engine_pm_put(engine); engine_heartbeat_enable(engine, heartbeat);
if (err) if (err)
break; break;
} }
...@@ -172,9 +192,11 @@ static int live_idle_pulse(void *arg) ...@@ -172,9 +192,11 @@ static int live_idle_pulse(void *arg)
/* Check that heartbeat pulses flush the idle barriers */ /* Check that heartbeat pulses flush the idle barriers */
for_each_engine(engine, gt, id) { for_each_engine(engine, gt, id) {
intel_engine_pm_get(engine); unsigned long heartbeat;
engine_heartbeat_disable(engine, &heartbeat);
err = __live_idle_pulse(engine, intel_engine_pulse); err = __live_idle_pulse(engine, intel_engine_pulse);
intel_engine_pm_put(engine); engine_heartbeat_enable(engine, heartbeat);
if (err && err != -ENODEV) if (err && err != -ENODEV)
break; break;
......
...@@ -331,8 +331,7 @@ void i915_active_unlock_wait(struct i915_active *ref) ...@@ -331,8 +331,7 @@ void i915_active_unlock_wait(struct i915_active *ref)
} }
/* And wait for the retire callback */ /* And wait for the retire callback */
spin_lock_irq(&ref->tree_lock); spin_unlock_wait(&ref->tree_lock);
spin_unlock_irq(&ref->tree_lock);
/* ... which may have been on a thread instead */ /* ... which may have been on a thread instead */
flush_work(&ref->work); flush_work(&ref->work);
......
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