Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Hajda, Andrzej" <andrzej.hajda@intel.com>
To: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 2/2] tests/xe_eudebug: Use library helper to enable ccs_mode
Date: Tue, 17 Dec 2024 10:34:17 +0100	[thread overview]
Message-ID: <7e2803d1-3298-4f57-be6a-e37517aae91c@intel.com> (raw)
In-Reply-To: <20241216131137.50945-2-dominik.grzegorzek@intel.com>


W dniu 16.12.2024 o 14:11, Dominik Grzegorzek pisze:
> igt_require call within ccs_mode_all_enginesi() when
> condition was not met left fd variable uninitialized, what
> caused xe_eudebug_enable in the cleanup fixure to fail like below:
>
> Test assertion failure function enable_getset, file ../lib/xe/xe_eudebug.c:1795:
> (xe_eudebug:23606) xe/xe_eudebug-CRITICAL: Failed assertion: fstat(fd, &st) == 0
> (xe_eudebug:23606) xe/xe_eudebug-CRITICAL: Last errno: 9, Bad file descriptor
> (xe_eudebug:23606) xe/xe_eudebug-CRITICAL: error: -1 != 0
> Stack trace:
>    #0 ../lib/igt_core.c:2051 __igt_fail_assert()
>    #1 ../lib/xe/xe_eudebug.c:1851 xe_eudebug_enable()
>    #2 ../tests/intel/xe_eudebug.c:2870 __igt_unique____real_main2757()
>    #3 ../tests/intel/xe_eudebug.c:2757 main()
>    #4 ../sysdeps/nptl/libc_start_call_main.h:58 __libc_start_call_main()
>    #5 ../csu/libc-start.c:128 __libc_start_main@@GLIBC_2.34()
>
> Fix that by using xe_sysfs_enable_css_mode library function which opens
> drm fd before calling igt_require. As here, move the check outside the
> fixture to simplify code.
>
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej

> ---
>   tests/intel/xe_eudebug.c | 38 ++++----------------------------------
>   1 file changed, 4 insertions(+), 34 deletions(-)
>
> diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
> index 22b0da658..c566d0980 100644
> --- a/tests/intel/xe_eudebug.c
> +++ b/tests/intel/xe_eudebug.c
> @@ -26,6 +26,7 @@
>   #include "xe/xe_eudebug.h"
>   #include "xe/xe_ioctl.h"
>   #include "xe/xe_query.h"
> +#include "xe/xe_util.h"
>   
>   /**
>    * SUBTEST: sysfs-toggle
> @@ -2729,31 +2730,6 @@ static void test_basic_exec_queues_enable(int fd)
>   	xe_vm_destroy(fd, vm_non_lr);
>   }
>   
> -static void ccs_mode_all_engines(int num_gt)
> -{
> -	int fd, gt, gt_fd, num_slices, ccs_mode;
> -	int num_gts_with_ccs_mode = 0;
> -
> -	for (gt = 0; gt < num_gt; gt++) {
> -		fd = drm_open_driver(DRIVER_XE);
> -		gt_fd = xe_sysfs_gt_open(fd, gt);
> -		close(fd);
> -
> -		if (igt_sysfs_scanf(gt_fd, "num_cslices", "%u", &num_slices) <= 0)
> -			continue;
> -
> -		num_gts_with_ccs_mode++;
> -
> -		igt_assert(igt_sysfs_printf(gt_fd, "ccs_mode", "%u", num_slices) > 0);
> -		igt_assert(igt_sysfs_scanf(gt_fd, "ccs_mode", "%u", &ccs_mode) > 0);
> -		igt_assert(num_slices == ccs_mode);
> -		close(gt_fd);
> -	}
> -
> -	errno = 0;
> -	igt_require(num_gts_with_ccs_mode > 0);
> -}
> -
>   igt_main
>   {
>   	bool was_enabled;
> @@ -2856,15 +2832,9 @@ igt_main
>   	igt_subtest("discovery-empty-clients")
>   		test_empty_discovery(fd, DISCOVERY_DESTROY_RESOURCES, 16);
>   
> -	igt_subtest_group {
> -		igt_fixture {
> -			drm_close_driver(fd);
> -			ccs_mode_all_engines(gt_count);
> -			fd = drm_open_driver(DRIVER_XE);
> -		}
> -
> -		igt_subtest("exec-queue-placements")
> -			test_basic_sessions(fd, EXEC_QUEUES_PLACEMENTS, 1, true);
> +	igt_subtest("exec-queue-placements") {
> +		xe_sysfs_enable_ccs_mode(&fd);
> +		test_basic_sessions(fd, EXEC_QUEUES_PLACEMENTS, 1, true);
>   	}
>   
>   	igt_fixture {

  reply	other threads:[~2024-12-17  9:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 13:11 [PATCH i-g-t 1/2] lib/xe/xe_util: introduce helper for enabling ccs mode Dominik Grzegorzek
2024-12-16 13:11 ` [PATCH i-g-t 2/2] tests/xe_eudebug: Use library helper to enable ccs_mode Dominik Grzegorzek
2024-12-17  9:34   ` Hajda, Andrzej [this message]
2024-12-16 20:15 ` ✓ i915.CI.BAT: success for series starting with [i-g-t,1/2] lib/xe/xe_util: introduce helper for enabling ccs mode Patchwork
2024-12-16 20:55 ` ✓ Xe.CI.BAT: " Patchwork
2024-12-16 23:06 ` ✗ Xe.CI.Full: failure " Patchwork
2024-12-17  4:32 ` ✗ i915.CI.Full: " Patchwork
2025-01-17 13:07 ` [PATCH i-g-t 1/2] " Manszewski, Christoph
2025-01-17 13:18   ` Manszewski, Christoph
2025-01-20 12:49     ` Kamil Konieczny

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=7e2803d1-3298-4f57-be6a-e37517aae91c@intel.com \
    --to=andrzej.hajda@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