Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>,
	<igt-dev@lists.freedesktop.org>,
	"Badal Nilawar" <badal.nilawar@intel.com>
Subject: Re: [PATCH i-g-t] tests/xe_gt_freq: Use sync reset
Date: Thu, 26 Sep 2024 10:36:38 -0400	[thread overview]
Message-ID: <ZvVxdqTnPu7O3iSn@intel.com> (raw)
In-Reply-To: <20240925220923.2030384-1-vinay.belgaumkar@intel.com>

On Wed, Sep 25, 2024 at 03:09:23PM -0700, Vinay Belgaumkar wrote:
> Some recent WAs reduce the GT freq during driver load/reset. Use sync
> reset so that we give enough time for GT frequency to be restored after
> reset has completed.
> 
> Also, stash/restore frequencies per GT as they can be different.
> 
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2676
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2711
> 
> Cc: Badal Nilawar <badal.nilawar@intel.com>
> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  tests/intel/xe_gt_freq.c | 24 +++++++++++++++++-------
>  1 file changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/intel/xe_gt_freq.c b/tests/intel/xe_gt_freq.c
> index 427e12c55..de4d111ea 100644
> --- a/tests/intel/xe_gt_freq.c
> +++ b/tests/intel/xe_gt_freq.c
> @@ -341,7 +341,8 @@ static void test_reset(int fd, int gt_id, int cycles)
>  		igt_assert_f(get_freq(fd, gt_id, "cur") == rpn,
>  			     "Failed after %d good cycles\n", i);
>  
> -		xe_force_gt_reset_async(fd, gt_id);
> +		xe_force_gt_reset_sync(fd, gt_id);
> +
>  		usleep(SLPC_FREQ_LATENCY_US);
>  
>  		igt_assert_f(get_freq(fd, gt_id, "min") == rpn,
> @@ -433,16 +434,23 @@ igt_main
>  	int fd;
>  	int gt;
>  	struct drm_xe_engine_class_instance *hwe;
> -	uint32_t stash_min;
> -	uint32_t stash_max;
> +	uint32_t *stash_min, *stash_max;
> +	int num_gts;
>  
>  	igt_fixture {
>  		fd = drm_open_driver(DRIVER_XE);
>  
>  		igt_require(xe_sysfs_gt_has_node(fd, 0, "freq0"));
> +		num_gts = xe_number_gt(fd);
> +
>  		/* The defaults are the same. Stashing the gt0 is enough */
> -		stash_min = get_freq(fd, 0, "min");
> -		stash_max = get_freq(fd, 0, "max");
> +		stash_min = (uint32_t *) malloc(sizeof(uint32_t) * num_gts);
> +		stash_max = (uint32_t *) malloc(sizeof(uint32_t) * num_gts);
> +
> +		xe_for_each_gt(fd, gt) {
> +			stash_min[gt] = get_freq(fd, gt, "min");
> +			stash_max[gt] = get_freq(fd, gt, "max");
> +		}
>  	}
>  
>  	igt_subtest("throttle_basic_api") {
> @@ -517,9 +525,11 @@ igt_main
>  
>  	igt_fixture {
>  		xe_for_each_gt(fd, gt) {
> -			set_freq(fd, gt, "min", stash_min);
> -			set_freq(fd, gt, "max", stash_max);
> +			set_freq(fd, gt, "max", stash_max[gt]);
> +			set_freq(fd, gt, "min", stash_min[gt]);
>  		}
> +		free(stash_min);
> +		free(stash_max);
>  		drm_close_driver(fd);
>  	}
>  }
> -- 
> 2.38.1
> 

  parent reply	other threads:[~2024-09-26 14:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 22:09 [PATCH i-g-t] tests/xe_gt_freq: Use sync reset Vinay Belgaumkar
2024-09-26  9:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-09-26 10:21 ` ✗ CI.xeBAT: failure " Patchwork
2024-09-27 18:02   ` Belgaumkar, Vinay
2024-09-26 12:43 ` ✗ Fi.CI.IGT: " Patchwork
2024-09-27 18:04   ` Belgaumkar, Vinay
2024-09-26 14:36 ` Rodrigo Vivi [this message]
2024-09-27  2:33 ` ✗ CI.xeFULL: " Patchwork
2024-09-27 18:07   ` Belgaumkar, Vinay
2024-10-03 18:54 ` ✓ CI.xeBAT: success for tests/xe_gt_freq: Use sync reset (rev2) Patchwork
2024-10-03 19:09 ` ✓ Fi.CI.BAT: " Patchwork
2024-10-03 21:15 ` ✗ CI.xeFULL: failure " Patchwork
2024-10-03 21:27 ` [PATCH i-g-t] tests/xe_gt_freq: Use sync reset Dixit, Ashutosh

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=ZvVxdqTnPu7O3iSn@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vinay.belgaumkar@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