summaryrefslogtreecommitdiff
path: root/lib/igt_gt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-13 11:04:40 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-13 11:13:42 +0100
commite442481c9cf35a1c509b836cf076bae597296200 (patch)
treefa11d64e780dd7c84e3bb0a06ae7fb3d0328a39e /lib/igt_gt.c
parent48c028a9477eec84eb67a9469b5b9bf18ebf5a48 (diff)
lib/igt_gt: Use /sys/.../error instead of /debug/.../i915_error_state
The stable path is via sys, but we only have to use this should the kernel be ignoring our request to ignore simulated hangs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_gt.c')
-rw-r--r--lib/igt_gt.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index a94cad32..a1659323 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -33,6 +33,7 @@
#include "igt_aux.h"
#include "igt_core.h"
#include "igt_gt.h"
+#include "igt_sysfs.h"
#include "igt_debugfs.h"
#include "ioctl_wrappers.h"
#include "intel_reg.h"
@@ -70,17 +71,17 @@ static bool has_gpu_reset(int fd)
return once;
}
-static void eat_error_state(void)
+static void eat_error_state(int dev)
{
- int fd, ret;
+ int dir;
- fd = igt_debugfs_open("i915_error_state", O_WRONLY);
- do {
- ret = write(fd, "", 1);
- if (ret < 0)
- ret = -errno;
- } while (ret == -EINTR || ret == -EAGAIN);
- close(fd);
+ dir = igt_sysfs_open(dev, NULL);
+ if (dir < 0)
+ return;
+
+ /* Any write to the error state clears it */
+ igt_sysfs_set(dir, "error", "");
+ close(dir);
}
/**
@@ -175,7 +176,7 @@ void igt_disallow_hang(int fd, igt_hang_t arg)
param.param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE;
param.value = 0;
if (__gem_context_set_param(fd, &param))
- eat_error_state();
+ eat_error_state(fd);
}
}
@@ -332,7 +333,7 @@ void igt_post_hang_ring(int fd, igt_hang_t arg)
param.param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE;
param.value = 0;
if (__gem_context_set_param(fd, &param))
- eat_error_state();
+ eat_error_state(fd);
}
}