Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: igt-dev@lists.freedesktop.org, Ashutosh Dixit <ashutosh.dixit@intel.com>
Subject: [PATCH i-g-t] tests/intel/xe_oa: Get stream status on read error
Date: Wed,  9 Apr 2025 16:34:41 -0700	[thread overview]
Message-ID: <20250409233441.143402-1-umesh.nerlige.ramappa@intel.com> (raw)

Whenever read fails, get stream status so we know the state of OA status
bits.

Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
---
 tests/intel/xe_oa.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
index 67acc74b3279..f3521c3d602e 100644
--- a/tests/intel/xe_oa.c
+++ b/tests/intel/xe_oa.c
@@ -2294,6 +2294,7 @@ static void test_polling_small_buf(void)
 	errno = 0;
 	ret = read(stream_fd, buf, sizeof(buf));
 	igt_assert_eq(ret, -1);
+	get_stream_status(stream_fd);
 	igt_assert_eq(errno, ENOSPC);
 
 	/* Poll with 0 timeout and expect POLLIN flag to be set */
@@ -2568,6 +2569,7 @@ test_enable_disable(const struct drm_xe_engine_class_instance *hwe)
 	errno = 0;
 	ret = read(stream_fd, buf, sizeof(buf));
 	igt_assert_eq(ret, -1);
+	get_stream_status(stream_fd);
 	igt_assert_eq(errno, EINVAL);
 
 	do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_ENABLE, 0);
@@ -2584,6 +2586,7 @@ test_enable_disable(const struct drm_xe_engine_class_instance *hwe)
 	/* Ensure num_reports can be read */
 	while ((ret = read(stream_fd, buf, sizeof(buf))) < 0 && errno == EINTR)
 		;
+	get_stream_status(stream_fd);
 	igt_assert_eq(ret, sizeof(buf));
 
 	__perf_close(stream_fd);
@@ -2727,6 +2730,7 @@ test_non_sampling_read_error(void)
 
 	ret = read(stream_fd, buf, sizeof(buf));
 	igt_assert_eq(ret, -1);
+	get_stream_status(stream_fd);
 	igt_assert_eq(errno, EINVAL);
 
 	__perf_close(stream_fd);
@@ -2768,6 +2772,7 @@ test_disabled_read_error(void)
 
 	ret = read(stream_fd, buf, sizeof(buf));
 	igt_assert_eq(ret, -1);
+	get_stream_status(stream_fd);
 	igt_assert_eq(errno, EINVAL);
 
 	__perf_close(stream_fd);
@@ -2786,6 +2791,7 @@ test_disabled_read_error(void)
 
 	ret = read(stream_fd, buf, sizeof(buf));
 	igt_assert_eq(ret, -1);
+	get_stream_status(stream_fd);
 	igt_assert_eq(errno, EINVAL);
 
 	do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_ENABLE, 0);
-- 
2.43.0


             reply	other threads:[~2025-04-09 23:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 23:34 Umesh Nerlige Ramappa [this message]
2025-04-10  2:35 ` ✓ Xe.CI.BAT: success for tests/intel/xe_oa: Get stream status on read error Patchwork
2025-04-10  3:27 ` ✗ Xe.CI.Full: failure " Patchwork
2025-04-10  8:34 ` ✗ i915.CI.BAT: " Patchwork
2025-04-10 20:33 ` [PATCH i-g-t] " Dixit, Ashutosh
2025-04-14 22:19   ` Umesh Nerlige Ramappa
2025-04-14 23:19     ` Dixit, Ashutosh
2025-04-14 23:26       ` Umesh Nerlige Ramappa

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=20250409233441.143402-1-umesh.nerlige.ramappa@intel.com \
    --to=umesh.nerlige.ramappa@intel.com \
    --cc=ashutosh.dixit@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