summaryrefslogtreecommitdiff
path: root/tests/debugfs_test.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-07-04 13:21:09 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-07-04 13:33:20 +0200
commitdf66d04b80f6665d27125fce7d8992ce72473d75 (patch)
treed54212b2d64349912aa011266267f01564e89b62 /tests/debugfs_test.c
parent0d84b26008f65a339cffec9fea95d3a7e713740a (diff)
tests/debugfs_test: Allow opening CRC to fail with -EIO.
This currently only happens when the power well is not enabled, but in theory should happen every time the file is opened when the CRTC is not enabled. This fixes debugfs_test@read_all_entries failing on f2-bxt-j3405. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests/debugfs_test.c')
-rw-r--r--tests/debugfs_test.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index 3f0eaae6..287ffeb3 100644
--- a/tests/debugfs_test.c
+++ b/tests/debugfs_test.c
@@ -29,7 +29,7 @@
#include <sys/types.h>
#include <dirent.h>
-static void read_and_discard_sysfs_entries(int path_fd)
+static void read_and_discard_sysfs_entries(int path_fd, bool is_crc)
{
struct dirent *dirent;
DIR *dir;
@@ -47,10 +47,19 @@ static void read_and_discard_sysfs_entries(int path_fd)
igt_assert((sub_fd =
openat(path_fd, dirent->d_name, O_RDONLY |
O_DIRECTORY)) > 0);
- read_and_discard_sysfs_entries(sub_fd);
+ read_and_discard_sysfs_entries(sub_fd, !strcmp(dirent->d_name, "crc"));
close(sub_fd);
} else {
char *buf = igt_sysfs_get(path_fd, dirent->d_name);
+
+ /*
+ * /crtc-XX/crc/data may fail with -EIO if the CRTC
+ * is not active.
+ */
+ if (!buf && is_crc && errno == EIO &&
+ !strcmp(dirent->d_name, "data"))
+ continue;
+
igt_assert(buf);
free(buf);
}
@@ -70,7 +79,7 @@ igt_main
}
igt_subtest("read_all_entries") {
- read_and_discard_sysfs_entries(debugfs);
+ read_and_discard_sysfs_entries(debugfs, false);
}
igt_subtest("emon_crash") {