diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-12-16 13:13:58 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-12-16 13:46:47 +0000 |
commit | 40798efd859e26386d32ec61272c210685b6a204 (patch) | |
tree | a906bd0d67f757edcd493998207f878ba1593cc7 /tests/gem_eio.c | |
parent | 3953d2dd22ea1c87aa77e3a9415aaf767d2ec3ed (diff) |
tests/gem_eio: New ABI - no EIO even from wait_ioctl
So there's 3 competing proposals for what wait_ioctl should do wrt
-EIO:
- return -EIO when the gpu is wedged. Not terribly useful for
userspace since it might race with a hang and then there's no
guarantee that a subsequent execbuf won't end up in an -EIO.
Terminally wedge really can only be reliably signalled at execbuf
time, and userspace needs to cope with that (or decide not to
bother).
- EIO for any obj that suffered from a reset. This means big internal
reorginazation in the kernel since currently we track reset stats
per-ctx and not on the obj. That's also what arb robustness wants.
We could do this, but this feels like new ABI territory with the
usual userspace requirements and high hurdles.
- No -EIO at all. Consistent with set_domain_ioctl and simplest to
implement. Which is what this patch does.
We can always opt to change this later on if there's a real need.
To make the test really exercise this do a full wedged gpu hang, to
make sure -EIO doesn't leak out at all.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_eio.c')
-rw-r--r-- | tests/gem_eio.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/gem_eio.c b/tests/gem_eio.c index a24c8f1c..b0cbf80f 100644 --- a/tests/gem_eio.c +++ b/tests/gem_eio.c @@ -161,10 +161,22 @@ static void test_wait(int fd) { igt_hang_ring_t hang; + /* If the request we wait on completes due to a hang (even for + * that request), the user expects the return value to 0 (success). + */ hang = igt_hang_ring(fd, I915_EXEC_DEFAULT); - igt_assert_eq(__gem_wait(fd, hang.handle, -1), -EIO); + igt_assert_eq(__gem_wait(fd, hang.handle, -1), 0); igt_post_hang_ring(fd, hang); + /* If the GPU is wedged during the wait, again we expect the return + * value to be 0 (success). + */ + igt_require(i915_reset_control(false)); + hang = igt_hang_ring(fd, I915_EXEC_DEFAULT); + igt_assert_eq(__gem_wait(fd, hang.handle, -1), 0); + igt_post_hang_ring(fd, hang); + igt_require(i915_reset_control(true)); + trigger_reset(fd); } |