From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] tests/intel/xe_oa: Extend enable-disable to read after disabling stream
Date: Mon, 30 Mar 2026 13:14:59 -0700 [thread overview]
Message-ID: <87zf3pxef0.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <acq54YO/p+vH/cY3@soc-5CG1426VCC.clients.intel.com>
On Mon, 30 Mar 2026 10:58:57 -0700, Umesh Nerlige Ramappa wrote:
>
> On Tue, Mar 17, 2026 at 03:39:10PM -0700, Ashutosh Dixit wrote:
> > Extend enable-disable subtest to validate the new feature of reading after
> > disabling OA stream.
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
>
> LGTM,
>
> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
>
Thanks Umesh, but if you see Xe.CI.FULL results, the test actually
fails. See below.
> > ---
> > tests/intel/xe_oa.c | 25 +++++++++++++++++++++++++
> > 1 file changed, 25 insertions(+)
> >
> > diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
> > index 387f29535e..6a602a014c 100644
> > --- a/tests/intel/xe_oa.c
> > +++ b/tests/intel/xe_oa.c
> > @@ -2774,6 +2774,31 @@ test_enable_disable(const struct drm_xe_oa_unit *oau)
> > get_stream_status(stream_fd);
> > igt_assert_eq(ret, sizeof(buf));
> >
> > + /*
> > + * Wait again for number of reports specified in
> > + * DRM_XE_OA_PROPERTY_WAIT_NUM_REPORTS
> > + */
> > + pollfd.fd = stream_fd;
> > + pollfd.events = POLLIN;
> > + poll(&pollfd, 1, -1);
> > + igt_assert(pollfd.revents & POLLIN);
> > +
> > + do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_DISABLE, 0);
> > +
> > + /* Ensure num_reports can be read even with disabled stream */
> > + while ((ret = read(stream_fd, buf, sizeof(buf))) < 0 && errno == EINTR)
> > + ;
> > + get_stream_status(stream_fd);
> > + igt_assert_eq(ret, sizeof(buf));
The failure is here, where we sometimes see 1 report instead of 5
(wait_num_reports is 5). I finally figured out how it could happen.
Let's say 6 reports were available in the *previous* read (before disabling
the stream). Now if we read with a buffer size of 5 reports, in the kernel
pollin would remain set. So when we read the next time we only will read 1
report.
To get around this I have changed the above assert to just 'igt_assert(ret >
0)' basically:
igt_assert_lt(0, ret);
Thanks.
--
Ashutosh
> > +
> > + /* In non-blocking mode read till we see a -EAGAIN, signifying all available data is read */
> > + set_fd_flags(stream_fd, O_CLOEXEC | O_NONBLOCK);
> > + while ((ret = read(stream_fd, buf, sizeof(buf))) > 0 ||
> > + (ret == -1 && (errno == EINTR || errno == EIO)))
> > + ;
> > + igt_assert_eq(ret, -1);
> > + igt_assert_eq(errno, EAGAIN);
> > +
> > __perf_close(stream_fd);
> > }
> >
> > --
> > 2.48.1
> >
prev parent reply other threads:[~2026-03-30 20:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 22:39 [PATCH i-g-t] tests/intel/xe_oa: Extend enable-disable to read after disabling stream Ashutosh Dixit
2026-03-18 3:03 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-03-18 3:15 ` ✓ i915.CI.BAT: " Patchwork
2026-03-19 7:25 ` ✓ i915.CI.Full: " Patchwork
2026-03-19 16:07 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-28 1:15 ` ✓ Xe.CI.BAT: success for tests/intel/xe_oa: Extend enable-disable to read after disabling stream (rev2) Patchwork
2026-03-28 1:46 ` ✓ i915.CI.BAT: " Patchwork
2026-03-28 20:08 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-29 7:53 ` ✓ i915.CI.Full: success " Patchwork
2026-03-30 17:58 ` [PATCH i-g-t] tests/intel/xe_oa: Extend enable-disable to read after disabling stream Umesh Nerlige Ramappa
2026-03-30 20:14 ` Dixit, Ashutosh [this message]
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=87zf3pxef0.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=umesh.nerlige.ramappa@intel.com \
/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