diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-18 09:27:55 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-18 09:41:37 +0000 |
commit | d84a9ecda49ca1e138ea595c37caba824d0c0188 (patch) | |
tree | 524a330dac6fbe83056aedacb65b3c1d55d677e1 /tests/i915/sysfs_heartbeat_interval.c | |
parent | ee05a571255783837b18d626c4dff6cd9613cee2 (diff) |
i915/sysfs_heartbeat_interval: Tweak reset timeouts
Be more lenient in waiting for resets as the CPU scheduler may be
pre-occupied.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Andi Shyti <andi.shyti@intel.com>
Diffstat (limited to 'tests/i915/sysfs_heartbeat_interval.c')
-rw-r--r-- | tests/i915/sysfs_heartbeat_interval.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/i915/sysfs_heartbeat_interval.c b/tests/i915/sysfs_heartbeat_interval.c index 5da1d2e8..662f4865 100644 --- a/tests/i915/sysfs_heartbeat_interval.c +++ b/tests/i915/sysfs_heartbeat_interval.c @@ -41,7 +41,7 @@ #include "igt_debugfs.h" #define ATTR "heartbeat_interval_ms" -#define RESET_TIMEOUT 20 /* milliseconds, at least one jiffie for kworker */ +#define RESET_TIMEOUT 50 /* milliseconds, at least one jiffie for kworker */ static bool __enable_hangcheck(int dir, bool state) { @@ -80,6 +80,13 @@ static void set_preempt_timeout(int engine, unsigned int value) set_attr(engine, "preempt_timeout_ms", value); } +static int wait_for_reset(int fence) +{ + /* Do a double wait to paper over scheduler fluctuations */ + sync_fence_wait(fence, RESET_TIMEOUT); + return sync_fence_wait(fence, RESET_TIMEOUT); +} + static void test_idempotent(int i915, int engine) { unsigned int delays[] = { 1, 1000, 5000, 50000, 123456789 }; @@ -163,7 +170,7 @@ static uint64_t __test_timeout(int i915, int engine, unsigned int timeout) igt_spin_free(i915, spin[1]); - igt_assert_eq(sync_fence_wait(spin[0]->out_fence, RESET_TIMEOUT), 0); + igt_assert_eq(wait_for_reset(spin[0]->out_fence), 0); igt_assert_eq(sync_fence_status(spin[0]->out_fence), -EIO); igt_spin_free(i915, spin[0]); |