All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Upadhyay <tejas.upadhyay@intel.com>,
	igt-dev@lists.freedesktop.org,
	Badal Nilawar <badal.nilawar@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v7 3/4] tests/xe/xe_guc_pc: Change the sysfs paths
Date: Thu, 06 Jul 2023 18:01:23 -0700	[thread overview]
Message-ID: <87cz14cz6k.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230706104500.595707-4-himal.prasad.ghimiray@intel.com>

On Thu, 06 Jul 2023 03:44:59 -0700, Himal Prasad Ghimiray wrote:
>
> diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
> index 827693eb4..d70b08d1e 100644
> --- a/tests/xe/xe_guc_pc.c
> +++ b/tests/xe/xe_guc_pc.c
> @@ -137,8 +137,13 @@ static int set_freq(int sysfs, int gt_id, const char *freq_name, uint32_t freq)
>  {
>	int ret = -EAGAIN;
>	char path[32];
> +	char *gt_path;
> +
> +	gt_path = xe_gt_sysfs_path(sysfs, gt_id);
> +	igt_assert(snprintf(path, sizeof(path), "%s/freq_%s",
> +			    gt_path, freq_name) < sizeof(path));
> +	free(gt_path);
>
> -	sprintf(path, "device/gt%d/freq_%s", gt_id, freq_name);
>	while (ret == -EAGAIN)
>		ret = igt_sysfs_printf(sysfs, path, "%u", freq);
>	return ret;
> @@ -149,7 +154,12 @@ static uint32_t get_freq(int sysfs, int gt_id, const char *freq_name)
>	uint32_t freq;
>	int err = -EAGAIN;
>	char path[32];
> -	sprintf(path, "device/gt%d/freq_%s", gt_id, freq_name);
> +	char *gt_path;
> +
> +	gt_path = xe_gt_sysfs_path(sysfs, gt_id);
> +	igt_assert(snprintf(path, sizeof(path), "%s/freq_%s",
> +			    gt_path, freq_name) < sizeof(path));
> +	free(gt_path);

After the changes mentioned in Patch 2 the function prototypes will change
as mentioned in Patch 2 comments.

So we will now call xe_sysfs_gt_open() here and rename path[] to attr[] and
then we can do igt_sysfs_scanf/igt_sysfs_printf.

  reply	other threads:[~2023-07-07  1:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 10:44 [igt-dev] [PATCH i-g-t v7 0/4] Handle GT and tile seperation in IGT Himal Prasad Ghimiray
2023-07-06 10:44 ` [igt-dev] [PATCH i-g-t v7 1/4] lib/igt_sysfs: Add support to query number of tiles Himal Prasad Ghimiray
2023-07-06 23:46   ` Dixit, Ashutosh
2023-07-07  3:57     ` Ghimiray, Himal Prasad
2023-07-06 10:44 ` [igt-dev] [PATCH i-g-t v7 2/4] lib/igt_sysfs: Handling gt related sysfs uapi changes Himal Prasad Ghimiray
2023-07-07  0:56   ` Dixit, Ashutosh
2023-07-07  4:29     ` Ghimiray, Himal Prasad
2023-07-07  5:02     ` Ghimiray, Himal Prasad
2023-07-06 10:44 ` [igt-dev] [PATCH i-g-t v7 3/4] tests/xe/xe_guc_pc: Change the sysfs paths Himal Prasad Ghimiray
2023-07-07  1:01   ` Dixit, Ashutosh [this message]
2023-07-07  5:03     ` Ghimiray, Himal Prasad
2023-07-06 10:45 ` [igt-dev] [PATCH i-g-t v7 4/4] tests/xe/xe_sysfs_tile_prop: adds new test to verify per tile vram addr_range Himal Prasad Ghimiray
2023-07-07  1:10   ` Dixit, Ashutosh
2023-07-07  5:04     ` Ghimiray, Himal Prasad
2023-07-06 13:03 ` [igt-dev] ✓ Fi.CI.BAT: success for Handle GT and tile seperation in IGT (rev6) Patchwork
2023-07-06 13:12 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-06 17:12 ` [igt-dev] ✗ Fi.CI.IGT: 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=87cz14cz6k.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tejas.upadhyay@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.