Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_psr2_su: Print errno while it fails to read debugfs
@ 2020-06-11 13:52 Gwan-gyeong Mun
  2020-06-11 14:22 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gwan-gyeong Mun @ 2020-06-11 13:52 UTC (permalink / raw)
  To: igt-dev

This tests is being sporadically skipped in CI as it is not due
"PSR sink not reliable: yes". This commit adds printing of debugfs
("tests/kms_psr2_su: Print debugfs when skipping test"), but it is not
enough to track error cases.
It adds printing of errorno while it fails to read debugfs.

Cc: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
---
 lib/igt_psr.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 8c2f4ce6..899784dc 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -40,9 +40,15 @@ static bool psr_active_check(int debugfs_fd, enum psr_mode mode)
 {
 	char buf[PSR_STATUS_MAX_LEN];
 	const char *state = mode == PSR_MODE_1 ? "SRDENT" : "DEEP_SLEEP";
+	int ret;
 
-	igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
-				sizeof(buf));
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status",
+				     buf, sizeof(buf));
+	if (ret < 0) {
+		igt_debug("Could not read i915_edp_psr_status: %s\n",
+			  strerror(-ret));
+		return false;
+	}
 
 	igt_skip_on(strstr(buf, "PSR sink not reliable: yes"));
 
@@ -237,8 +243,11 @@ void psr_print_debugfs(int debugfs_fd)
 
 	ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
 				      sizeof(buf));
-	if (ret < 0)
+	if (ret < 0) {
+		igt_debug("Could not read i915_edp_psr_status: %s\n",
+			  strerror(-ret));
 		return;
+	}
 
 	igt_debug("%s", buf);
 }
-- 
2.25.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2020-06-12  7:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-11 13:52 [igt-dev] [PATCH i-g-t] tests/kms_psr2_su: Print errno while it fails to read debugfs Gwan-gyeong Mun
2020-06-11 14:22 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-06-11 15:31 ` [igt-dev] [PATCH i-g-t] " Souza, Jose
2020-06-12  7:49   ` Petri Latvala
2020-06-11 18:46 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

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