From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
igt-dev@lists.freedesktop.org
Cc: Andi Shyti <andi.shyti@linux.intel.com>,
Krzysztof Karas <krzysztof.karas@intel.com>,
Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Subject: Re: [PATCH i-g-t v2] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies
Date: Tue, 07 Apr 2026 13:42:20 +0200 [thread overview]
Message-ID: <1394b3dddf8d96243a814aa7c722e6894fd8ee89.camel@linux.intel.com> (raw)
In-Reply-To: <20260407105212.43821-2-krzysztof.niemiec@intel.com>
Hi Krzysztof,
On Tue, 2026-04-07 at 12:52 +0200, 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 clean up.
While I think your solution may be correct, your description is not clear
enough for me. How is it possible for the legacy interface to work as
expected when altering the environment, but not ant longer when restoring
defaults?
Thanks,
Janusz
>
> Signed-off-by: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
> ---
>
> v2:
> - Remove the redundant fd open from the i915_for_each_gt loop, as one
> is already created as part of the loop (Sebastian)
> - Remove extra newline (Krzysztof K)
>
> tests/intel/gem_exec_endless.c | 33 +++++++++++++++++----------------
> 1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/tests/intel/gem_exec_endless.c b/tests/intel/gem_exec_endless.c
> index 7f35e985c..f3ed8556c 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, gt;
>
> igt_fixture() {
> igt_require(gem_scheduler_enabled(i915));
> @@ -365,16 +365,17 @@ int igt_main()
> igt_device_get_pci_device(i915),
> false);
>
> - sysfs = igt_sysfs_open(i915);
> - pin_rps(sysfs);
> + i915_for_each_gt(i915, sysfs_gt, 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, sysfs_gt, gt)
> + unpin_rps(sysfs_gt);
> +
> intel_register_access_fini(&mmio);
> }
> }
next prev parent reply other threads:[~2026-04-07 11:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 10:52 [PATCH i-g-t v2] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies Krzysztof Niemiec
2026-04-07 11:42 ` Janusz Krzysztofik [this message]
2026-04-09 11:46 ` Krzysztof Niemiec
2026-04-09 12:28 ` Janusz Krzysztofik
2026-04-09 14:01 ` Krzysztof Niemiec
2026-04-09 7:43 ` ✓ Xe.CI.BAT: success for tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies (rev2) Patchwork
2026-04-09 7:56 ` ✓ i915.CI.BAT: " Patchwork
2026-04-09 8:52 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-09 19:54 ` ✗ i915.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=1394b3dddf8d96243a814aa7c722e6894fd8ee89.camel@linux.intel.com \
--to=janusz.krzysztofik@linux.intel.com \
--cc=andi.shyti@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=krzysztof.karas@intel.com \
--cc=krzysztof.niemiec@intel.com \
--cc=sebastian.brzezinka@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