Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/kms_psr2_su: Print errno while it fails to read debugfs
Date: Thu, 11 Jun 2020 16:52:38 +0300	[thread overview]
Message-ID: <20200611135238.176102-1-gwan-gyeong.mun@intel.com> (raw)

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

             reply	other threads:[~2020-06-11 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 13:52 Gwan-gyeong Mun [this message]
2020-06-11 14:22 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_psr2_su: Print errno while it fails to read debugfs 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200611135238.176102-1-gwan-gyeong.mun@intel.com \
    --to=gwan-gyeong.mun@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox