[PATCH i-g-t] tests/intel/xe_oa: Save and restore errno in get_stream_status
Dixit, Ashutosh
ashutosh.dixit at intel.com
Thu Apr 17 23:00:51 UTC 2025
On Thu, 17 Apr 2025 15:39:31 -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 saving and restoring errno within get_stream_status.
>
> v2: Go back to calling get_stream_status unconditionally (Ashutosh)
Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
>
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4804
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
> ---
> tests/intel/xe_oa.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
> index 1fc8bfaafee2..a219f80fdcf3 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;
> }
> --
> 2.45.2
>
More information about the igt-dev
mailing list