All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
To: Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
	<igt-dev@lists.freedesktop.org>
Cc: Andi Shyti <andi.shyti@linux.intel.com>,
	Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>,
	Krzysztof Karas <krzysztof.karas@intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Subject: Re: [PATCH i-g-t] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies
Date: Thu, 2 Apr 2026 13:24:52 +0200	[thread overview]
Message-ID: <DHIMQVF67ANT.23LIAAMEJIANT@intel.com> (raw)
In-Reply-To: <20260402110411.6367-2-krzysztof.niemiec@intel.com>

Hi Krzysztof,

On Thu Apr 2, 2026 at 1:04 PM CEST, Krzysztof Niemiec wrote:
> The test alters the environment, specifically the gt frequencies, for
> its duration. Using the legacy interface, however, makes it impossible for
> the pre-test state to be restored due to its limitations in multi-gt
> systems. Use the per-gt interface instead to properly set the values and
> clean up.
>
> Signed-off-by: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
> ---
>  tests/intel/gem_exec_endless.c | 38 ++++++++++++++++++++--------------
>  1 file changed, 22 insertions(+), 16 deletions(-)
>
> diff --git a/tests/intel/gem_exec_endless.c b/tests/intel/gem_exec_endless.c
> index 7f35e985c..9f41d812e 100644
> --- a/tests/intel/gem_exec_endless.c
> +++ b/tests/intel/gem_exec_endless.c
> @@ -316,28 +316,28 @@ static void endless_dispatch(int i915, const struct intel_execution_engine2 *e)
>  		for_each_if(gem_class_can_store_dword(i915, (e)->class)) \
>  			igt_dynamic_f("%s", (e)->name)
>  
> -static void pin_rps(int sysfs)
> +static void pin_rps(int sysfs_gt)
>  {
>  	unsigned int max;
>  
> -	if (igt_sysfs_scanf(sysfs, "gt_RP0_freq_mhz", "%u", &max) != 1)
> +	if (igt_sysfs_scanf(sysfs_gt, "rps_RP0_freq_mhz", "%u", &max) != 1)
>  		return;
>  
> -	igt_sysfs_printf(sysfs, "gt_min_freq_mhz", "%u", max);
> -	igt_sysfs_printf(sysfs, "gt_max_freq_mhz", "%u", max);
> -	igt_sysfs_printf(sysfs, "gt_boost_freq_mhz", "%u", max);
> +	igt_sysfs_printf(sysfs_gt, "rps_min_freq_mhz", "%u", max);
> +	igt_sysfs_printf(sysfs_gt, "rps_max_freq_mhz", "%u", max);
> +	igt_sysfs_printf(sysfs_gt, "rps_boost_freq_mhz", "%u", max);
>  }
>  
> -static void unpin_rps(int sysfs)
> +static void unpin_rps(int sysfs_gt)
>  {
>  	unsigned int v;
>  
> -	if (igt_sysfs_scanf(sysfs, "gt_RPn_freq_mhz", "%u", &v) == 1)
> -		igt_sysfs_printf(sysfs, "gt_min_freq_mhz", "%u", v);
> +	if (igt_sysfs_scanf(sysfs_gt, "rps_RPn_freq_mhz", "%u", &v) == 1)
> +		igt_sysfs_printf(sysfs_gt, "rps_min_freq_mhz", "%u", v);
>  
> -	if (igt_sysfs_scanf(sysfs, "gt_RP0_freq_mhz", "%u", &v) == 1) {
> -		igt_sysfs_printf(sysfs, "gt_max_freq_mhz", "%u", v);
> -		igt_sysfs_printf(sysfs, "gt_boost_freq_mhz", "%u", v);
> +	if (igt_sysfs_scanf(sysfs_gt, "rps_RP0_freq_mhz", "%u", &v) == 1) {
> +		igt_sysfs_printf(sysfs_gt, "rps_max_freq_mhz", "%u", v);
> +		igt_sysfs_printf(sysfs_gt, "rps_boost_freq_mhz", "%u", v);
>  	}
>  }
>  
> @@ -355,7 +355,7 @@ int igt_main()
>  
>  	igt_subtest_group() {
>  		struct intel_mmio_data mmio;
> -		int sysfs;
> +		int sysfs_gt, tmp, gt;
>  
>  		igt_fixture() {
>  			igt_require(gem_scheduler_enabled(i915));
> @@ -365,16 +365,22 @@ int igt_main()
>  						   igt_device_get_pci_device(i915),
>  						   false);
>  
> -			sysfs = igt_sysfs_open(i915);
> -			pin_rps(sysfs);
> +			i915_for_each_gt(i915, tmp, gt) {
> +				sysfs_gt = igt_sysfs_gt_open(i915, gt);
Isn’t sysfs_gt already opened as a tmp file? Also, is sysfs_gt closed anywhere?
```
#define for_each_sysfs_gt_dirfd(i915__, dirfd__, gt__) \
	for (gt__ = 0; \
	     (dirfd__ = igt_sysfs_gt_open(i915__, gt__)) != -1; \
	     close(dirfd__), gt__++)

```
 
> +				pin_rps(sysfs_gt);
> +			}
> +
>  		}
>  
>  		test_each_engine("dispatch", i915, e)
>  				endless_dispatch(i915, e);
>  
>  		igt_fixture() {
> -			unpin_rps(sysfs);
> -			close(sysfs);
> +			i915_for_each_gt(i915, tmp, gt) {
> +				sysfs_gt = igt_sysfs_gt_open(i915, gt);
> +				unpin_rps(sysfs_gt);
> +				close(sysfs_gt);
I see this close() but im not sure if it's same fd.

> +			}
>  			intel_register_access_fini(&mmio);
>  		}
>  	}




-- 
Best regards,
Sebastian


  reply	other threads:[~2026-04-02 11:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 11:04 [PATCH i-g-t] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies Krzysztof Niemiec
2026-04-02 11:24 ` Sebastian Brzezinka [this message]
2026-04-03  6:21   ` Krzysztof Karas
2026-04-02 12:04 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-04-02 12:11 ` ✓ i915.CI.BAT: " Patchwork
2026-04-02 20:39 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-03  9:16 ` ✗ i915.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=DHIMQVF67ANT.23LIAAMEJIANT@intel.com \
    --to=sebastian.brzezinka@intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.com \
    --cc=krzysztof.karas@intel.com \
    --cc=krzysztof.niemiec@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.