mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-20 14:26:17 +00:00
lib/igt_gt: Handle SIGINT whilst writing to i915_error_state
Becareful in case we try and eat the error state whilst interrupts are being sent and repeat the write() until we finish uninterrupted. References: https://bugs.freedesktop.org/show_bug.cgi?id=94573 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
5df2de7e14
commit
34098b71fa
@ -225,10 +225,14 @@ igt_hang_ring_t igt_hang_ring(int fd, int ring)
|
||||
|
||||
static void eat_error_state(void)
|
||||
{
|
||||
int fd;
|
||||
int fd, ret;
|
||||
|
||||
fd = igt_debugfs_open("i915_error_state", O_WRONLY);
|
||||
igt_assert(write(fd, "", 1) == 1);
|
||||
do {
|
||||
ret = write(fd, "", 1);
|
||||
if (ret < 0)
|
||||
ret = -errno;
|
||||
} while (ret == -EINTR || ret == -EAGAIN);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user