Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>
To: Riana Tauro <riana.tauro@intel.com>, <igt-dev@lists.freedesktop.org>
Cc: badal.nilawar@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t] tests/xe: Add a test to toggle GT C states
Date: Mon, 7 Aug 2023 10:46:24 -0700	[thread overview]
Message-ID: <c6b6d413-68f7-540c-3a1f-67507c945490@intel.com> (raw)
In-Reply-To: <20230803054810.2842880-1-riana.tauro@intel.com>


On 8/2/2023 10:48 PM, Riana Tauro wrote:
> Add a test that toggles GT C states by checking if GT is in C0 when
> forcewake is acquired and in C6 once released.
>
> v2: change test name (Suja, Anshuman)
>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
>   tests/xe/xe_pm_residency.c | 26 ++++++++++++++++++++++++++
>   1 file changed, 26 insertions(+)
>
> diff --git a/tests/xe/xe_pm_residency.c b/tests/xe/xe_pm_residency.c
> index 4936de166..1c12113bc 100644
> --- a/tests/xe/xe_pm_residency.c
> +++ b/tests/xe/xe_pm_residency.c
> @@ -38,6 +38,10 @@ const double tolerance = 0.1;
>    * Description: basic residency test to validate idle residency
>    *		measured over a time interval is within the tolerance
>    * Run type: FULL
> + *
> + * SUBTEST: toggle-gt-c6
> + * Description: Toggle GT C states by acquiring/releasing forcewake
> + * Run type: FULL
>    */
>   IGT_TEST_DESCRIPTION("Tests for gtidle properties");
>   
> @@ -85,6 +89,24 @@ static void test_idle_residency(int fd, int gt)
>   	assert_within_epsilon(residency_end - residency_start, elapsed_ms, tolerance);
>   }
>   
> +static void toggle_gt_c6(int fd, int n)
> +{
> +	int handle, gt;
> +
> +	while (n--) {
> +		handle = igt_debugfs_open(fd, "forcewake_all", O_WRONLY);
> +		igt_assert(handle >= 0);
> +		/* check if all gts are in C0 after forcewake is acquired */
> +		xe_for_each_gt(fd, gt)
> +			igt_assert_f(!xe_is_gt_in_c6(fd, gt), "GT in C6\n");
If it asserts here, will the test reset the force wake before exiting? 
If not, we need some kind of exit handler that does that.
> +		close(handle);

Do you need some delay here to ensure GT goes into C6?

Thanks,

Vinay.

> +		/* check if all gts are in C6 after forcewake is released */
> +		xe_for_each_gt(fd, gt)
> +			igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1),
> +				     "GT is not in C6\n");
> +	}
> +}
> +
>   igt_main
>   {
>   	int fd, gt;
> @@ -104,6 +126,10 @@ igt_main
>   		xe_for_each_gt(fd, gt)
>   			test_idle_residency(fd, gt);
>   
> +	igt_describe("Toggle GT C states by acquiring/releasing forcewake");
> +	igt_subtest("toggle-gt-c6")
> +		toggle_gt_c6(fd, 16);
Why aren't we running this per GT? Also, please add a #define like 
NUM_REPS or something instead of using 16 here.
> +
>   	igt_fixture {
>   		close(fd);
>   	}

  parent reply	other threads:[~2023-08-07 17:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  5:48 [igt-dev] [PATCH i-g-t] tests/xe: Add a test to toggle GT C states Riana Tauro
2023-08-03  6:39 ` [igt-dev] ○ CI.xeBAT: info for " Patchwork
2023-08-03  6:44 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-08-03  8:54 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-08-07 17:46 ` Belgaumkar, Vinay [this message]
2023-08-08  6:13   ` [igt-dev] [PATCH i-g-t] " Riana Tauro

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=c6b6d413-68f7-540c-3a1f-67507c945490@intel.com \
    --to=vinay.belgaumkar@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=riana.tauro@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