Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
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: Call get_stream_status only on EIO
Date: Wed, 16 Apr 2025 16:16:40 -0700	[thread overview]
Message-ID: <87cydbhf3b.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20250416231203.13916-1-umesh.nerlige.ramappa@intel.com>

On Wed, 16 Apr 2025 16:12:02 -0700, Umesh Nerlige Ramappa wrote:
>
> Turns out that get_stream_status resets errno and anything that checks
> errno afterwards fails. This resulted in a bunch of test failures. Fix
> it by calling get_stream_status only if errno is EIO and also save and
> restore errno within get_stream_status.
>
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4804
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> ---
>  tests/intel/xe_oa.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
> index 1fc8bfaafee2..360dd8ba00d9 100644
> --- a/tests/intel/xe_oa.c
> +++ b/tests/intel/xe_oa.c
> @@ -380,9 +380,11 @@ static void set_fd_flags(int fd, int flags)
>  static u32 get_stream_status(int fd)
>  {
>	struct drm_xe_oa_stream_status status;
> +	int _e = errno;
>
>	do_ioctl(fd, DRM_XE_OBSERVATION_IOCTL_STATUS, &status);
>	igt_debug("oa status %llx\n", status.oa_status);
> +	errno = _e;
>
>	return status.oa_status;
>  }
> @@ -2294,7 +2296,8 @@ 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);
> +	if (errno == EIO)
> +		get_stream_status(stream_fd);

Hi Umesh, if we are saving/restoring errno in get_stream_status(), do we
still need to check for EIO? Or you just want to check for EIO anyhow?

Thanks.
--
Ashutosh

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 23:12 [PATCH i-g-t] tests/intel/xe_oa: Call get_stream_status only on EIO Umesh Nerlige Ramappa
2025-04-16 23:16 ` Dixit, Ashutosh [this message]
2025-04-17 19:00   ` Umesh Nerlige Ramappa
2025-04-17 19:16     ` Dixit, Ashutosh
2025-04-17  1:15 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-04-17  1:22 ` ✓ i915.CI.BAT: " Patchwork
2025-04-17 14:10 ` ✗ i915.CI.Full: failure " Patchwork
2025-04-17 15:15 ` ✗ Xe.CI.Full: " 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=87cydbhf3b.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