public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] tests/debugfs_test: Use O_NONBLOCK
@ 2019-09-08 16:19 Chris Wilson
  2019-09-09  7:26 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2019-09-09  9:15 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2019-09-08 16:19 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

Since we are just reading from each debugfs file, any that requires
initial setup may not be fully setup or be left in a state that results
in the file *expectedly* waiting. Use O_NONBLOCK to avoid waits on
external events as we are just peeking for a trivial check that the
files do not explode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/debugfs_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index 6d1757c50..f8dd851c9 100644
--- a/tests/debugfs_test.c
+++ b/tests/debugfs_test.c
@@ -65,7 +65,7 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent)
 			igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name);
 			igt_set_timeout(5, "reading sysfs entry");
 
-			sub_fd = openat(path_fd, dirent->d_name, O_RDONLY);
+			sub_fd = openat(path_fd, dirent->d_name, O_RDONLY | O_NONBLOCK);
 			if (sub_fd == -1) {
 				igt_debug("%sCould not open file \"%s\" with error: %m\n",
 					  tabs, dirent->d_name);
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-09  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-08 16:19 [Intel-gfx] [PATCH i-g-t] tests/debugfs_test: Use O_NONBLOCK Chris Wilson
2019-09-09  7:26 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-09-09  9:15 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox