From df66d04b80f6665d27125fce7d8992ce72473d75 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Tue, 4 Jul 2017 13:21:09 +0200 Subject: 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 --- tests/debugfs_test.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'tests/debugfs_test.c') 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 #include -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") { -- cgit v1.2.3