diff mbox series

[1/3] drm/i915/selftests: Be loud if we run out of time

Message ID 20180808091007.18036-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/i915/selftests: Be loud if we run out of time | expand

Commit Message

Chris Wilson Aug. 8, 2018, 9:10 a.m. UTC
On flushing the tests, we do so with a timeout to prevent waiting
indefinitely. However, if we miss an interrupt, the timeout provides a
safety net that still completes successfully (as we check the completion
condition after reaching the timeout and see all is well). This safety
net can unfortunately mask some bugs, so let's add a warning here so we
don't just ignore it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/selftests/igt_flush_test.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/selftests/igt_flush_test.c b/drivers/gpu/drm/i915/selftests/igt_flush_test.c
index af66e3d4e23a..da620ed7cc36 100644
--- a/drivers/gpu/drm/i915/selftests/igt_flush_test.c
+++ b/drivers/gpu/drm/i915/selftests/igt_flush_test.c
@@ -19,7 +19,8 @@  int igt_flush_test(struct drm_i915_private *i915, unsigned int flags)
 		i915_gem_set_wedged(i915);
 	}
 
-	if (i915_gem_wait_for_idle(i915, flags, HZ / 5) == -ETIME) {
+	switch (i915_gem_wait_for_idle(i915, flags, HZ / 5)) {
+	case -ETIME:
 		pr_err("%pS timed out, cancelling all further testing.\n",
 		       __builtin_return_address(0));
 
@@ -27,6 +28,12 @@  int igt_flush_test(struct drm_i915_private *i915, unsigned int flags)
 		GEM_TRACE_DUMP();
 
 		i915_gem_set_wedged(i915);
+		break;
+
+	case 0:
+		pr_err("%pS missed idle-completion interrupt\n",
+		       __builtin_return_address(0));
+		break;
 	}
 
 	return i915_terminally_wedged(&i915->gpu_error) ? -EIO : 0;