Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Riana Tauro <riana.tauro@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v2 1/2] tests/intel/xe_configfs: Use openat to simplify check
Date: Tue, 3 Jun 2025 11:45:20 +0530	[thread overview]
Message-ID: <886273d8-b3ac-4ecc-ac14-15a1e4887bb6@intel.com> (raw)
In-Reply-To: <20250602-engines-allowed-v2-1-52bffe717766@intel.com>

Hi Lucas

On 6/2/2025 9:54 PM, Lucas De Marchi wrote:
> No need to create the path again. Just make sure there's such attribute
> relative to the fd passed.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>   tests/intel/xe_configfs.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/tests/intel/xe_configfs.c b/tests/intel/xe_configfs.c
> index e5701b7d1..074cd04d9 100644
> --- a/tests/intel/xe_configfs.c
> +++ b/tests/intel/xe_configfs.c
> @@ -43,16 +43,13 @@ static void set_survivability_mode(int configfs_device_fd, bool value)
>    */
>   static void test_survivability_mode(int configfs_device_fd)
>   {
> -	char path[PATH_MAX];
>   	int fd;
>   
>   	/* Enable survivability mode */
>   	set_survivability_mode(configfs_device_fd, true);
>   
>   	/* check presence of survivability mode sysfs */
> -	snprintf(path, PATH_MAX, "/sys/bus/pci/devices/%s/survivability_mode", bus_addr);

This is the file that indicates that the device entered survivability 
mode. This is under /sys/bus/pci/devices/<bdf>/ not the one in configfs

Thanks
Riana

> -
> -	fd = open(path, O_RDONLY);
> +	fd = openat(configfs_device_fd, "survivability_mode", O_RDONLY);
>   	igt_assert_f(fd >= 0, "Survivability mode not set\n");
>   	close(fd);
>   }
> 


  reply	other threads:[~2025-06-03  6:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-02 16:24 [PATCH i-g-t v2 0/2] xe: Add test for engines_allowed in configfs Lucas De Marchi
2025-06-02 16:24 ` [PATCH i-g-t v2 1/2] tests/intel/xe_configfs: Use openat to simplify check Lucas De Marchi
2025-06-03  6:15   ` Riana Tauro [this message]
2025-06-03  6:37     ` Lucas De Marchi
2025-06-02 16:24 ` [PATCH i-g-t v2 2/2] tests/intel/xe_configfs: Test engines_allowed Lucas De Marchi
2025-06-06 11:16   ` Riana Tauro
2025-06-09 22:42   ` Umesh Nerlige Ramappa
2025-06-12 21:27     ` Lucas De Marchi
2025-06-02 21:19 ` ✓ i915.CI.BAT: success for xe: Add test for engines_allowed in configfs Patchwork
2025-06-02 21:21 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-03  1:01 ` ✓ i915.CI.Full: " Patchwork
2025-06-03 20:17 ` ✗ Xe.CI.Full: failure " 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=886273d8-b3ac-4ecc-ac14-15a1e4887bb6@intel.com \
    --to=riana.tauro@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@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