diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-02-16 16:16:22 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-02-17 20:28:05 +0000 |
commit | 7a05faa0be53fa1544ec950290129d20e4101c72 (patch) | |
tree | 5b761d79d9f693ed9605505c20f032473405603d | |
parent | a6fe2f89911549f9068bb951de185357e365b84a (diff) |
i915/gem_exec_balancer: Impose a timeout for hang completion
Expect the hang to be detected and cleaned up within a short period
(thanks to the error interrupt) and then we can reasonably quickly
determine if the cleanup failed!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Matthew Auld <matthew.auld@intel.com>
-rw-r--r-- | tests/i915/gem_exec_balancer.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c index f51be339..35429eda 100644 --- a/tests/i915/gem_exec_balancer.c +++ b/tests/i915/gem_exec_balancer.c @@ -1688,14 +1688,19 @@ static void hangme(int i915) for (int i = 0; i < count; i++) { struct client *c = &client[i]; + int64_t timeout; igt_debug("Waiting for client[%d].spin[%d]\n", i, 0); - gem_sync(i915, c->spin[0]->handle); + timeout = NSEC_PER_SEC / 2; + if (gem_wait(i915, c->spin[0]->handle, &timeout)) + igt_debugfs_dump(i915, "i915_engine_info"); igt_assert_eq(sync_fence_status(c->spin[0]->out_fence), -EIO); igt_debug("Waiting for client[%d].spin[%d]\n", i, 1); - gem_sync(i915, c->spin[1]->handle); + timeout = NSEC_PER_SEC / 2; + if (gem_wait(i915, c->spin[1]->handle, &timeout)) + igt_debugfs_dump(i915, "i915_engine_info"); igt_assert_eq(sync_fence_status(c->spin[1]->out_fence), -EIO); |