All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt v2 1/3] igt/gem_eio: inflight wedged requires long plugging
@ 2017-09-13 10:40 Chris Wilson
  2017-09-13 10:40 ` [PATCH igt v2 2/3] igt/gem_eio: Exercise wedged with native in-flight requests Chris Wilson
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Chris Wilson @ 2017-09-13 10:40 UTC (permalink / raw)
  To: intel-gfx

As our hangcheck may exceed 10s to declare the device wedged, we need to
hold the plugging fence indefinitely. This makes using vgem as our input
fence unusable, so resort to using sw_sync. At the same time, we can
then check that the async result is also -EIO.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102616
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
---
 tests/gem_eio.c | 81 +++++++++++++++++++++++----------------------------------
 1 file changed, 32 insertions(+), 49 deletions(-)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 207a9ef9..00502378 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -39,7 +39,7 @@
 
 #include <drm.h>
 
-#include "igt_vgem.h"
+#include "sw_sync.h"
 
 IGT_TEST_DESCRIPTION("Test that specific ioctls report a wedged GPU (EIO).");
 
@@ -158,66 +158,49 @@ static void test_wait(int fd)
 	trigger_reset(fd);
 }
 
-struct cork {
-	int device;
-	uint32_t handle;
-	uint32_t fence;
-};
-
-static void plug(int fd, struct cork *c)
-{
-	struct vgem_bo bo;
-	int dmabuf;
-
-	c->device = __drm_open_driver(DRIVER_VGEM);
-	igt_require(c->device != -1);
-
-	bo.width = bo.height = 1;
-	bo.bpp = 4;
-	vgem_create(c->device, &bo);
-	c->fence = vgem_fence_attach(c->device, &bo, VGEM_FENCE_WRITE);
-
-	dmabuf = prime_handle_to_fd(c->device, bo.handle);
-	c->handle = prime_fd_to_handle(fd, dmabuf);
-	close(dmabuf);
-}
-
-static void unplug(struct cork *c)
-{
-	vgem_fence_signal(c->device, c->fence);
-	close(c->device);
-}
-
-static void test_inflight(int fd)
+static void test_inflight_external(int fd)
 {
 	struct drm_i915_gem_execbuffer2 execbuf;
-	struct drm_i915_gem_exec_object2 obj[2];
+	struct drm_i915_gem_exec_object2 obj;
 	uint32_t bbe = MI_BATCH_BUFFER_END;
 	igt_hang_t hang;
-	struct cork cork;
+	int timeline, fence;
+
+	igt_require_sw_sync();
+	igt_require(gem_has_exec_fence(fd));
+
+	timeline = sw_sync_timeline_create();
+	fence = sw_sync_timeline_create_fence(timeline, 1);
 
 	igt_require(i915_reset_control(false));
 	hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
 
-	plug(fd, &cork);
-
-	memset(obj, 0, sizeof(obj));
-	obj[0].handle = cork.handle;
-	obj[1].handle = gem_create(fd, 4096);
-	gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
+	memset(&obj, 0, sizeof(obj));
+	obj.handle = gem_create(fd, 4096);
+	gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
 
 	memset(&execbuf, 0, sizeof(execbuf));
-	execbuf.buffers_ptr = to_user_pointer(obj);
-	execbuf.buffer_count = 2;
+	execbuf.buffers_ptr = to_user_pointer(&obj);
+	execbuf.buffer_count = 1;
+	execbuf.flags = I915_EXEC_FENCE_IN | I915_EXEC_FENCE_OUT;
+	execbuf.rsvd2 = (uint32_t)fence;
 
-	gem_execbuf(fd, &execbuf);
+	gem_execbuf_wr(fd, &execbuf);
+	close(fence);
 
-	igt_post_hang_ring(fd, hang);
-	unplug(&cork); /* only now submit our batches */
-	igt_assert_eq(__gem_wait(fd, obj[1].handle, -1), 0);
+	fence = execbuf.rsvd2 >> 32;
+	igt_assert(fence != -1);
 
-	igt_require(i915_reset_control(true));
+	igt_post_hang_ring(fd, hang); /* wedged, with an unready batch */
+	sw_sync_timeline_inc(timeline, 1); /* only now submit our batches */
+
+	igt_assert_eq(__gem_wait(fd, obj.handle, -1), 0);
+	igt_assert_eq(sync_fence_status(fence), -EIO);
+	close(fence);
+
+	igt_assert(i915_reset_control(true));
 	trigger_reset(fd);
+	close(timeline);
 }
 
 static int fd = -1;
@@ -254,6 +237,6 @@ igt_main
 	igt_subtest("wait")
 		test_wait(fd);
 
-	igt_subtest("in-flight")
-		test_inflight(fd);
+	igt_subtest("in-flight-external")
+		test_inflight_external(fd);
 }
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH igt v2 2/3] igt/gem_eio: Exercise wedged with native in-flight requests
  2017-09-13 10:40 [PATCH igt v2 1/3] igt/gem_eio: inflight wedged requires long plugging Chris Wilson
@ 2017-09-13 10:40 ` Chris Wilson
  2017-09-14 13:50   ` [PATCH igt] " Chris Wilson
  2017-09-13 10:40 ` [PATCH igt v2 3/3] igt/gem_eio: Check wedged with inflight on the same engine Chris Wilson
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2017-09-13 10:40 UTC (permalink / raw)
  To: intel-gfx

If we wedged one engine with unready requests to a second engine
(blocked by waiting on requests from the first, using a dma-fence),
check that we propagate the -EIO to those in-flight requests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_eio.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 88 insertions(+), 1 deletion(-)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 00502378..7aa4af8f 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -27,7 +27,6 @@
  *
  */
 
-#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -39,6 +38,8 @@
 
 #include <drm.h>
 
+#include "igt.h"
+#include "igt_sysfs.h"
 #include "sw_sync.h"
 
 IGT_TEST_DESCRIPTION("Test that specific ioctls report a wedged GPU (EIO).");
@@ -203,6 +204,85 @@ static void test_inflight_external(int fd)
 	close(timeline);
 }
 
+static void test_inflight_internal(int fd)
+{
+	struct drm_i915_gem_execbuffer2 execbuf;
+	struct drm_i915_gem_exec_object2 obj[2];
+	uint32_t bbe = MI_BATCH_BUFFER_END;
+	igt_hang_t hang;
+	int fence;
+
+	igt_require(gem_has_exec_fence(fd));
+
+	gem_require_ring(fd, I915_EXEC_BLT);
+
+	igt_require(i915_reset_control(false));
+	hang = igt_hang_ring(fd, I915_EXEC_RENDER);
+
+	memset(obj, 0, sizeof(obj));
+	obj[0].handle = hang.handle;
+	obj[0].flags = EXEC_OBJECT_WRITE;
+	obj[1].handle = gem_create(fd, 4096);
+	gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj);
+	execbuf.buffer_count = 2;
+	execbuf.flags = I915_EXEC_BLT | I915_EXEC_FENCE_OUT;
+
+	gem_execbuf_wr(fd, &execbuf);
+	fence = execbuf.rsvd2 >> 32;
+	igt_assert(fence != -1);
+
+	igt_post_hang_ring(fd, hang); /* wedged, with an unready batch */
+
+	igt_assert_eq(__gem_wait(fd, obj[1].handle, -1), 0);
+	igt_assert_eq(sync_fence_status(fence), -EIO);
+	close(fence);
+
+	igt_assert(i915_reset_control(true));
+	trigger_reset(fd);
+}
+
+#define HAVE_EXECLISTS 0x1
+#define HAVE_GUC 0x2
+#define HAVE_SEMAPHORES 0x4
+
+static unsigned print_welcome(int fd)
+{
+	unsigned flags = 0;
+	bool active;
+	int dir;
+
+	dir = igt_sysfs_open_parameters(fd);
+	if (dir < 0)
+		return 0;
+
+	active = igt_sysfs_get_boolean(dir, "enable_guc_submission");
+	if (active) {
+		igt_info("Using GuC submission\n");
+		flags |= HAVE_GUC | HAVE_EXECLISTS;
+		goto out;
+	}
+
+	active = igt_sysfs_get_boolean(dir, "enable_execlists");
+	if (active) {
+		igt_info("Using Execlists submission\n");
+		flags |= HAVE_EXECLISTS;
+		goto out;
+	}
+
+	active = igt_sysfs_get_boolean(dir, "semaphores");
+	if (active)
+		flags |= HAVE_SEMAPHORES;
+	igt_info("Using Legacy submission%s\n",
+		 active ? ", with semaphores" : "");
+
+out:
+	close(dir);
+	return flags;
+}
+
 static int fd = -1;
 
 static void
@@ -214,6 +294,7 @@ exit_handler(int sig)
 
 igt_main
 {
+	unsigned int caps = 0;
 
 	igt_skip_on_simulation();
 
@@ -224,6 +305,7 @@ igt_main
 		igt_force_gpu_reset(fd);
 		igt_install_exit_handler(exit_handler);
 
+		caps = print_welcome(fd);
 		igt_require_gem(fd);
 		igt_require_hang_ring(fd, I915_EXEC_DEFAULT);
 	}
@@ -239,4 +321,9 @@ igt_main
 
 	igt_subtest("in-flight-external")
 		test_inflight_external(fd);
+
+	igt_subtest("in-flight-internal") {
+		igt_skip_on(caps & HAVE_SEMAPHORES);
+		test_inflight_internal(fd);
+	}
 }
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH igt v2 3/3] igt/gem_eio: Check wedged with inflight on the same engine
  2017-09-13 10:40 [PATCH igt v2 1/3] igt/gem_eio: inflight wedged requires long plugging Chris Wilson
  2017-09-13 10:40 ` [PATCH igt v2 2/3] igt/gem_eio: Exercise wedged with native in-flight requests Chris Wilson
@ 2017-09-13 10:40 ` Chris Wilson
  2017-09-14 13:50   ` [PATCH igt] " Chris Wilson
  2017-09-13 12:31 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging Patchwork
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2017-09-13 10:40 UTC (permalink / raw)
  To: intel-gfx

Some overlap with gem_exec_fence, but confirm that light for waiting on
a fence (both native and external), that a request queued is also
flagged as EIO upon wedging.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_eio.c | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 7aa4af8f..8b9bec90 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -159,6 +159,44 @@ static void test_wait(int fd)
 	trigger_reset(fd);
 }
 
+static void test_inflight(int fd)
+{
+	struct drm_i915_gem_execbuffer2 execbuf;
+	struct drm_i915_gem_exec_object2 obj[2];
+	uint32_t bbe = MI_BATCH_BUFFER_END;
+	igt_hang_t hang;
+	int fence;
+
+	igt_require(gem_has_exec_fence(fd));
+
+	igt_require(i915_reset_control(false));
+	hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
+
+	memset(obj, 0, sizeof(obj));
+	obj[0].handle = hang.handle;
+	obj[0].flags = EXEC_OBJECT_WRITE;
+	obj[1].handle = gem_create(fd, 4096);
+	gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj);
+	execbuf.buffer_count = 2;
+	execbuf.flags = I915_EXEC_DEFAULT | I915_EXEC_FENCE_OUT;
+
+	gem_execbuf_wr(fd, &execbuf);
+	fence = execbuf.rsvd2 >> 32;
+	igt_assert(fence != -1);
+
+	igt_post_hang_ring(fd, hang);
+
+	igt_assert_eq(__gem_wait(fd, obj[1].handle, -1), 0);
+	igt_assert_eq(sync_fence_status(fence), -EIO);
+	close(fence);
+
+	igt_assert(i915_reset_control(true));
+	trigger_reset(fd);
+}
+
 static void test_inflight_external(int fd)
 {
 	struct drm_i915_gem_execbuffer2 execbuf;
@@ -319,6 +357,9 @@ igt_main
 	igt_subtest("wait")
 		test_wait(fd);
 
+	igt_subtest("in-flight")
+		test_inflight(fd);
+
 	igt_subtest("in-flight-external")
 		test_inflight_external(fd);
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging
  2017-09-13 10:40 [PATCH igt v2 1/3] igt/gem_eio: inflight wedged requires long plugging Chris Wilson
  2017-09-13 10:40 ` [PATCH igt v2 2/3] igt/gem_eio: Exercise wedged with native in-flight requests Chris Wilson
  2017-09-13 10:40 ` [PATCH igt v2 3/3] igt/gem_eio: Check wedged with inflight on the same engine Chris Wilson
@ 2017-09-13 12:31 ` Patchwork
  2017-09-13 19:23 ` ✗ Fi.CI.IGT: failure " Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2017-09-13 12:31 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging
URL   : https://patchwork.freedesktop.org/series/30275/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
b6ea8b204c8a18af7098326522e8acaffb19dd7a tests/tools_test: Make sure l3_parity is supported

with latest DRM-Tip kernel build CI_DRM_3083
29603d09af9a drm-tip: 2017y-09m-13d-09h-38m-49s UTC integration manifest

Test chamelium:
        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                skip       -> PASS       (fi-skl-x1585l) fdo#101781
        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (fi-ivb-3520m) fdo#102699

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781
fdo#102699 https://bugs.freedesktop.org/show_bug.cgi?id=102699

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:446s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:458s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:377s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:544s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:268s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:509s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:506s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:500s
fi-cfl-s         total:289  pass:223  dwarn:34  dfail:0   fail:0   skip:32  time:560s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:452s
fi-glk-2a        total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:598s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:431s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:408s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:441s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:486s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:468s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:488s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:578s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:592s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:548s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:463s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:524s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:492s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:467s
fi-skl-x1585l    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:502s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:569s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:1   skip:39  time:429s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_182/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* ✗ Fi.CI.IGT: failure for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging
  2017-09-13 10:40 [PATCH igt v2 1/3] igt/gem_eio: inflight wedged requires long plugging Chris Wilson
                   ` (2 preceding siblings ...)
  2017-09-13 12:31 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging Patchwork
@ 2017-09-13 19:23 ` Patchwork
  2017-09-14 14:22 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging (rev3) Patchwork
  2017-09-14 17:12 ` ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2017-09-13 19:23 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging
URL   : https://patchwork.freedesktop.org/series/30275/
State : failure

== Summary ==

Test perf:
        Subgroup polling:
                pass       -> FAIL       (shard-hsw) fdo#102252 +1
Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-hsw) fdo#99912
Test kms_busy:
        Subgroup extended-modeset-hang-oldfb-with-reset-render-B:
                dmesg-warn -> PASS       (shard-hsw) fdo#102692
Test kms_frontbuffer_tracking:
        Subgroup psr-1p-primscrn-spr-indfb-onoff:
                skip       -> INCOMPLETE (shard-hsw)
Test kms_plane:
        Subgroup plane-panning-bottom-right-suspend-pipe-C-planes:
                skip       -> PASS       (shard-hsw)
Test drv_module_reload:
        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (shard-hsw) fdo#102707

fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102692 https://bugs.freedesktop.org/show_bug.cgi?id=102692
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707

shard-hsw        total:2315 pass:1224 dwarn:0   dfail:0   fail:12  skip:1033 time:9324s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_182/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH igt] igt/gem_eio: Exercise wedged with native in-flight requests
  2017-09-13 10:40 ` [PATCH igt v2 2/3] igt/gem_eio: Exercise wedged with native in-flight requests Chris Wilson
@ 2017-09-14 13:50   ` Chris Wilson
  2017-09-15 16:59     ` Michał Winiarski
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2017-09-14 13:50 UTC (permalink / raw)
  To: intel-gfx

If we wedged one engine with unready requests to a second engine
(blocked by waiting on requests from the first, using a dma-fence),
check that we propagate the -EIO to those in-flight requests.

v2: check all ABI engines

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_eio.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 00502378..648ca29c 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -27,7 +27,6 @@
  *
  */
 
-#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -39,6 +38,8 @@
 
 #include <drm.h>
 
+#include "igt.h"
+#include "igt_sysfs.h"
 #include "sw_sync.h"
 
 IGT_TEST_DESCRIPTION("Test that specific ioctls report a wedged GPU (EIO).");
@@ -203,6 +204,90 @@ static void test_inflight_external(int fd)
 	close(timeline);
 }
 
+static void test_inflight_internal(int fd)
+{
+	struct drm_i915_gem_execbuffer2 execbuf;
+	struct drm_i915_gem_exec_object2 obj[2];
+	uint32_t bbe = MI_BATCH_BUFFER_END;
+	unsigned engine, nfence = 0;
+	int fences[16];
+	igt_hang_t hang;
+
+	igt_require(gem_has_exec_fence(fd));
+
+	igt_require(i915_reset_control(false));
+	hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
+
+	memset(obj, 0, sizeof(obj));
+	obj[0].handle = hang.handle;
+	obj[0].flags = EXEC_OBJECT_WRITE;
+	obj[1].handle = gem_create(fd, 4096);
+	gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj);
+	execbuf.buffer_count = 2;
+	for_each_engine(fd, engine) {
+		execbuf.flags = engine | I915_EXEC_FENCE_OUT;
+
+		gem_execbuf_wr(fd, &execbuf);
+
+		fences[nfence] = execbuf.rsvd2 >> 32;
+		igt_assert(fences[nfence] != -1);
+		nfence++;
+	}
+
+	igt_post_hang_ring(fd, hang); /* wedged, with an unready batch */
+
+	igt_assert_eq(__gem_wait(fd, obj[1].handle, -1), 0);
+	while (nfence--) {
+		igt_assert_eq(sync_fence_status(fences[nfence]), -EIO);
+		close(fences[nfence]);
+	}
+
+	igt_assert(i915_reset_control(true));
+	trigger_reset(fd);
+}
+
+#define HAVE_EXECLISTS 0x1
+#define HAVE_GUC 0x2
+#define HAVE_SEMAPHORES 0x4
+
+static unsigned print_welcome(int fd)
+{
+	unsigned flags = 0;
+	bool active;
+	int dir;
+
+	dir = igt_sysfs_open_parameters(fd);
+	if (dir < 0)
+		return 0;
+
+	active = igt_sysfs_get_boolean(dir, "enable_guc_submission");
+	if (active) {
+		igt_info("Using GuC submission\n");
+		flags |= HAVE_GUC | HAVE_EXECLISTS;
+		goto out;
+	}
+
+	active = igt_sysfs_get_boolean(dir, "enable_execlists");
+	if (active) {
+		igt_info("Using Execlists submission\n");
+		flags |= HAVE_EXECLISTS;
+		goto out;
+	}
+
+	active = igt_sysfs_get_boolean(dir, "semaphores");
+	if (active)
+		flags |= HAVE_SEMAPHORES;
+	igt_info("Using Legacy submission%s\n",
+		 active ? ", with semaphores" : "");
+
+out:
+	close(dir);
+	return flags;
+}
+
 static int fd = -1;
 
 static void
@@ -214,6 +299,7 @@ exit_handler(int sig)
 
 igt_main
 {
+	unsigned int caps = 0;
 
 	igt_skip_on_simulation();
 
@@ -224,6 +310,7 @@ igt_main
 		igt_force_gpu_reset(fd);
 		igt_install_exit_handler(exit_handler);
 
+		caps = print_welcome(fd);
 		igt_require_gem(fd);
 		igt_require_hang_ring(fd, I915_EXEC_DEFAULT);
 	}
@@ -239,4 +326,9 @@ igt_main
 
 	igt_subtest("in-flight-external")
 		test_inflight_external(fd);
+
+	igt_subtest("in-flight-internal") {
+		igt_skip_on(caps & HAVE_SEMAPHORES);
+		test_inflight_internal(fd);
+	}
 }
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH igt] igt/gem_eio: Check wedged with inflight on the same engine
  2017-09-13 10:40 ` [PATCH igt v2 3/3] igt/gem_eio: Check wedged with inflight on the same engine Chris Wilson
@ 2017-09-14 13:50   ` Chris Wilson
  2017-09-15 17:26     ` Michał Winiarski
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2017-09-14 13:50 UTC (permalink / raw)
  To: intel-gfx

Some overlap with gem_exec_fence, but confirm that light for waiting on
a fence (both native and external), that a request queued is also
flagged as EIO upon wedging.

v2: check all ABI engines

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_eio.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 648ca29c..0fa98032 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -159,6 +159,54 @@ static void test_wait(int fd)
 	trigger_reset(fd);
 }
 
+static void test_inflight(int fd)
+{
+	struct drm_i915_gem_execbuffer2 execbuf;
+	struct drm_i915_gem_exec_object2 obj[2];
+	uint32_t bbe = MI_BATCH_BUFFER_END;
+	unsigned int engine;
+	int fence[64]; /* conservative estimate of ring size */
+
+	igt_require(gem_has_exec_fence(fd));
+
+	memset(obj, 0, sizeof(obj));
+	obj[0].flags = EXEC_OBJECT_WRITE;
+	obj[1].handle = gem_create(fd, 4096);
+	gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
+
+	for_each_engine(fd, engine) {
+		igt_hang_t hang;
+
+		igt_debug("Starting %s on engine '%s'\n", __func__, e__->name);
+		igt_require(i915_reset_control(false));
+
+		hang = igt_hang_ring(fd, engine);
+		obj[0].handle = hang.handle;
+
+		memset(&execbuf, 0, sizeof(execbuf));
+		execbuf.buffers_ptr = to_user_pointer(obj);
+		execbuf.buffer_count = 2;
+		execbuf.flags = engine | I915_EXEC_FENCE_OUT;
+
+		for (unsigned int n = 0; n < ARRAY_SIZE(fence); n++) {
+			gem_execbuf_wr(fd, &execbuf);
+			fence[n] = execbuf.rsvd2 >> 32;
+			igt_assert(fence[n] != -1);
+		}
+
+		igt_post_hang_ring(fd, hang);
+
+		igt_assert_eq(__gem_wait(fd, obj[1].handle, -1), 0);
+		for (unsigned int n = 0; n < ARRAY_SIZE(fence); n++) {
+			igt_assert_eq(sync_fence_status(fence[n]), -EIO);
+			close(fence[n]);
+		}
+
+		igt_assert(i915_reset_control(true));
+		trigger_reset(fd);
+	}
+}
+
 static void test_inflight_external(int fd)
 {
 	struct drm_i915_gem_execbuffer2 execbuf;
@@ -324,6 +372,9 @@ igt_main
 	igt_subtest("wait")
 		test_wait(fd);
 
+	igt_subtest("in-flight")
+		test_inflight(fd);
+
 	igt_subtest("in-flight-external")
 		test_inflight_external(fd);
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging (rev3)
  2017-09-13 10:40 [PATCH igt v2 1/3] igt/gem_eio: inflight wedged requires long plugging Chris Wilson
                   ` (3 preceding siblings ...)
  2017-09-13 19:23 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2017-09-14 14:22 ` Patchwork
  2017-09-14 17:12 ` ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2017-09-14 14:22 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging (rev3)
URL   : https://patchwork.freedesktop.org/series/30275/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
c718ba805208e55d675defe9b2a66852e2ae038c lib/igt_kmod: Allow specifying libkmod config via environment variables

with latest DRM-Tip kernel build CI_DRM_3088
36b5aec0a505 drm-tip: 2017y-09m-14d-12h-08m-39s UTC integration manifest

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                fail       -> PASS       (fi-snb-2600) fdo#100215

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:445s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:455s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:267s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:506s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:499s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:461s
fi-glk-2a        total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:602s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:430s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:405s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:438s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:495s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:466s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:482s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:586s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:557s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:466s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:529s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:510s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:463s
fi-skl-x1585l    total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:487s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:428s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_187/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* ✓ Fi.CI.IGT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging (rev3)
  2017-09-13 10:40 [PATCH igt v2 1/3] igt/gem_eio: inflight wedged requires long plugging Chris Wilson
                   ` (4 preceding siblings ...)
  2017-09-14 14:22 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging (rev3) Patchwork
@ 2017-09-14 17:12 ` Patchwork
  5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2017-09-14 17:12 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging (rev3)
URL   : https://patchwork.freedesktop.org/series/30275/
State : success

== Summary ==

Test perf:
        Subgroup blocking:
                fail       -> PASS       (shard-hsw) fdo#102252 +1

fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw        total:2315 pass:1246 dwarn:0   dfail:0   fail:13  skip:1056 time:9485s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_187/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH igt] igt/gem_eio: Exercise wedged with native in-flight requests
  2017-09-14 13:50   ` [PATCH igt] " Chris Wilson
@ 2017-09-15 16:59     ` Michał Winiarski
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Winiarski @ 2017-09-15 16:59 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Thu, Sep 14, 2017 at 02:50:09PM +0100, Chris Wilson wrote:
> If we wedged one engine with unready requests to a second engine
> (blocked by waiting on requests from the first, using a dma-fence),
> check that we propagate the -EIO to those in-flight requests.
> 
> v2: check all ABI engines
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>

-Michał

> ---
>  tests/gem_eio.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 93 insertions(+), 1 deletion(-)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH igt] igt/gem_eio: Check wedged with inflight on the same engine
  2017-09-14 13:50   ` [PATCH igt] " Chris Wilson
@ 2017-09-15 17:26     ` Michał Winiarski
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Winiarski @ 2017-09-15 17:26 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Thu, Sep 14, 2017 at 02:50:56PM +0100, Chris Wilson wrote:
> Some overlap with gem_exec_fence, but confirm that light for waiting on
> a fence (both native and external), that a request queued is also
> flagged as EIO upon wedging.

There's something wrong with the construction of this sentence.

With that fixed:

Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>

-Michał

> v2: check all ABI engines
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/gem_eio.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-09-15 17:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13 10:40 [PATCH igt v2 1/3] igt/gem_eio: inflight wedged requires long plugging Chris Wilson
2017-09-13 10:40 ` [PATCH igt v2 2/3] igt/gem_eio: Exercise wedged with native in-flight requests Chris Wilson
2017-09-14 13:50   ` [PATCH igt] " Chris Wilson
2017-09-15 16:59     ` Michał Winiarski
2017-09-13 10:40 ` [PATCH igt v2 3/3] igt/gem_eio: Check wedged with inflight on the same engine Chris Wilson
2017-09-14 13:50   ` [PATCH igt] " Chris Wilson
2017-09-15 17:26     ` Michał Winiarski
2017-09-13 12:31 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging Patchwork
2017-09-13 19:23 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-09-14 14:22 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] igt/gem_eio: inflight wedged requires long plugging (rev3) Patchwork
2017-09-14 17:12 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.