lib: Remove defunct stop_rings

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/lib/drmtest.c b/lib/drmtest.c
index db65d79..01e874b 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -129,18 +129,6 @@
 	return true;
 }
 
-static void check_stop_rings(void)
-{
-	enum stop_ring_flags flags;
-	flags = igt_get_stop_rings();
-	igt_warn_on_f(flags != 0,
-		      "i915_ring_stop flags on exit 0x%x, can't quiescent gpu cleanly\n",
-		      flags);
-
-	if (flags)
-		igt_set_stop_rings(STOP_RING_NONE);
-}
-
 #define LOCAL_I915_EXEC_VEBOX	(4 << 0)
 /**
  * gem_quiescent_gpu:
@@ -161,8 +149,6 @@
 	struct drm_i915_gem_exec_object2 obj;
 	unsigned ring;
 
-	check_stop_rings();
-
 	memset(&obj, 0, sizeof(obj));
 	obj.handle = gem_create(fd, 4096);
 	gem_write(fd, obj.handle, 0, &bbe, sizeof(&bbe));
@@ -299,7 +285,6 @@
 	if (at_exit_drm_fd < 0)
 		return;
 
-	check_stop_rings();
 	gem_quiescent_gpu(at_exit_drm_fd);
 	close(at_exit_drm_fd);
 	at_exit_drm_fd = -1;
@@ -310,7 +295,6 @@
 	if (at_exit_drm_render_fd < 0)
 		return;
 
-	check_stop_rings();
 	gem_quiescent_gpu(at_exit_drm_render_fd);
 	close(at_exit_drm_render_fd);
 	at_exit_drm_render_fd = -1;
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index d2ae058..0236518 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -368,113 +368,6 @@
 		return -1;
 	return igt_debugfs_open("i915_forcewake_user", O_WRONLY);
 }
-
-/**
- * igt_to_stop_ring_flag:
- * @ring: the specified ring flag from execbuf ioctl (I915_EXEC_*)
- *
- * This converts the specified ring to a ring flag to be used
- * with igt_get_stop_rings() and igt_set_stop_rings().
- *
- * Returns:
- * Ring flag for the given ring.
- */
-enum stop_ring_flags igt_to_stop_ring_flag(int ring) {
-	if (ring == I915_EXEC_DEFAULT)
-		return STOP_RING_RENDER;
-
-	igt_assert(ring && ((ring & ~I915_EXEC_RING_MASK) == 0));
-	return 1 << (ring - 1);
-}
-
-static void stop_rings_write(uint32_t mask)
-{
-	int fd;
-	char buf[80];
-
-	igt_assert(snprintf(buf, sizeof(buf), "0x%08x", mask) == 10);
-	fd = igt_debugfs_open("i915_ring_stop", O_WRONLY);
-	igt_assert(fd >= 0);
-
-	igt_assert(write(fd, buf, strlen(buf)) == strlen(buf));
-	close(fd);
-}
-
-/**
- * igt_get_stop_rings:
- *
- * Read current ring flags from 'i915_ring_stop' debugfs entry.
- *
- * Returns:
- * Current ring flags.
- */
-enum stop_ring_flags igt_get_stop_rings(void)
-{
-	int fd;
-	char buf[80];
-	int l;
-	unsigned long long ring_mask;
-
-	fd = igt_debugfs_open("i915_ring_stop", O_RDONLY);
-	igt_assert(fd >= 0);
-	l = read(fd, buf, sizeof(buf)-1);
-	igt_assert(l > 0);
-	igt_assert(l < sizeof(buf));
-
-	buf[l] = '\0';
-
-	close(fd);
-
-	errno = 0;
-	ring_mask = strtoull(buf, NULL, 0);
-	igt_assert(errno == 0);
-	return ring_mask;
-}
-
-/**
- * igt_set_stop_rings:
- * @flags: Ring flags to write
- *
- * This writes @flags to 'i915_ring_stop' debugfs entry. Driver will
- * prevent the CPU from writing tail pointer for the ring that @flags
- * specify. Note that the ring is not stopped right away. Instead any
- * further command emissions won't be executed after the flag is set.
- *
- * This is the least invasive way to make the GPU stuck. Hence you must
- * set this after a batch submission with it's own invalid or endless
- * looping instructions. In this case it is merely for giving notification
- * for the driver that this was simulated hang, as the batch would have
- * caused hang in any case. On the other hand if you use a valid or noop
- * batch and want to hang the ring (GPU), you must set corresponding flag
- * before submitting the batch.
- *
- * Driver checks periodically if a ring is making any progress, and if
- * it is not, it will declare the ring to be hung and will reset the GPU.
- * After reset, the driver will clear flags in 'i915_ring_stop'
- *
- * Note: Always when hanging the GPU, use igt_set_stop_rings() to
- * notify the driver. Driver controls hang log messaging based on
- * these flags and thus prevents false positives on logs.
- */
-void igt_set_stop_rings(enum stop_ring_flags flags)
-{
-	enum stop_ring_flags current;
-
-	igt_assert((flags & ~(STOP_RING_ALL |
-			      STOP_RING_ALLOW_BAN |
-			      STOP_RING_ALLOW_ERRORS)) == 0);
-
-	current = igt_get_stop_rings();
-	igt_assert_f(flags == 0 || current == 0,
-		     "previous i915_ring_stop is still 0x%x\n", current);
-
-	stop_rings_write(flags);
-	current = igt_get_stop_rings();
-	igt_warn_on_f(current != flags,
-		      "i915_ring_stop readback mismatch 0x%x vs 0x%x\n",
-		      flags, current);
-}
-
 static unsigned int clflush_size;
 
 int igt_setup_clflush(void)
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index dfe1cfb..a05450d 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -55,39 +55,6 @@
 
 int igt_open_forcewake_handle(void);
 
-/**
- * stop_ring_flags:
- * @STOP_RING_NONE: Can be used to clear the pending stop (warning: hang might
- * be declared already). Returned by igt_get_stop_rings() if there is
- * no currently stopped rings.
- * @STOP_RING_RENDER: Render ring
- * @STOP_RING_BSD: Video encoding/decoding ring
- * @STOP_RING_BLT: Blitter ring
- * @STOP_RING_VEBOX: Video enhancement ring
- * @STOP_RING_ALL: All rings
- * @STOP_RING_ALLOW_ERRORS: Driver will not omit expected DRM_ERRORS
- * @STOP_RING_ALLOW_BAN: Driver will use context ban policy
- * @STOP_RING_DEFAULTS: STOP_RING_ALL | STOP_RING_ALLOW_ERRORS
- *
- * Enumeration of all supported flags for igt_set_stop_rings().
- *
- */
-enum stop_ring_flags {
-	STOP_RING_NONE = 0x00,
-	STOP_RING_RENDER = (1 << 0),
-	STOP_RING_BSD = (1 << 1),
-	STOP_RING_BLT = (1 << 2),
-	STOP_RING_VEBOX = (1 << 3),
-	STOP_RING_ALL = 0xff,
-	STOP_RING_ALLOW_ERRORS = (1 << 30),
-	STOP_RING_ALLOW_BAN = (1 << 31),
-	STOP_RING_DEFAULTS = STOP_RING_ALL | STOP_RING_ALLOW_ERRORS,
-};
-
-enum stop_ring_flags igt_to_stop_ring_flag(int ring);
-void igt_set_stop_rings(enum stop_ring_flags flags);
-enum stop_ring_flags igt_get_stop_rings(void);
-
 int igt_setup_clflush(void);
 void igt_clflush_range(void *addr, int size);
 
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index f4cdadb..4af031e 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -87,15 +87,6 @@
 	close (fd);
 }
 
-static void test_debugfs_ring_stop_exists(void)
-{
-	int fd;
-
-	igt_assert_lte(0, (fd = igt_debugfs_open("i915_ring_stop", O_RDONLY)));
-
-	close(fd);
-}
-
 static void read_dfs(const char *fname, char *d, int maxlen)
 {
 	int fd;
@@ -336,9 +327,6 @@
 	igt_subtest("error-state-sysfs-entry")
 		test_sysfs_error_exists();
 
-	igt_subtest("ring-stop-sysfs-entry")
-		test_debugfs_ring_stop_exists();
-
 	igt_subtest("error-state-basic")
 		test_error_state_basic();