Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
Cc: "Upadhyay, Tejas" <tejas.upadhyay@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Nilawar, Badal" <badal.nilawar@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v5 3/4] tests/xe/xe_guc_pc: Change the sysfs paths
Date: Wed, 05 Jul 2023 20:52:17 -0700	[thread overview]
Message-ID: <87jzvdd7da.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <MW4PR11MB705622CF81DC2DA73B1E09EEB32CA@MW4PR11MB7056.namprd11.prod.outlook.com>

On Wed, 05 Jul 2023 20:20:37 -0700, Ghimiray, Himal Prasad wrote:
>
> > -----Original Message-----
> > From: Dixit, Ashutosh <ashutosh.dixit@intel.com>
> > Sent: 06 July 2023 05:42
> > To: Ghimiray, Himal Prasad <himal.prasad.ghimiray@intel.com>
> > Cc: igt-dev@lists.freedesktop.org; Upadhyay, Tejas
> > <tejas.upadhyay@intel.com>; Iddamsetty, Aravind
> > <aravind.iddamsetty@intel.com>; Kamil Konieczny
> > <kamil.konieczny@linux.intel.com>; Nilawar, Badal
> > <badal.nilawar@intel.com>; Tauro, Riana <riana.tauro@intel.com>; Gupta,
> > Anshuman <anshuman.gupta@intel.com>
> > Subject: Re: [PATCH i-g-t v5 3/4] tests/xe/xe_guc_pc: Change the sysfs paths
> >
> > On Wed, 05 Jul 2023 01:52:58 -0700, Himal Prasad Ghimiray wrote:
> > >
> > > diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c index
> > > 827693eb4..046791d51 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",
> > > +			    xe_gt_sysfs_path(sysfs, gt_id), freq_name) <
> > sizeof(path));
> >
> > No need to do this, delete path[], gt_path can directly be passed
> > igt_sysfs_printf/scanf?
>
> Here we are appending the sysfs entry name to the gt_path. Why it is not needed ?

Sorry, I misspoke. But gt_path is not needed, you are not using it, you are
calling xe_gt_sysfs_path twice. Delete gt_path. Or do what you are doing
below. Do the same thing in both places.

>
> >
> > > +	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);
> > >	while (err == -EAGAIN)
> > >		err = igt_sysfs_scanf(sysfs, path, "%u", &freq);
> > >	return freq;
> > > --
> > > 2.25.1
> > >

  reply	other threads:[~2023-07-06  4:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05  8:52 [igt-dev] [PATCH i-g-t v5 0/4] Handle GT and tile seperation in IGT Himal Prasad Ghimiray
2023-07-05  8:52 ` [igt-dev] [PATCH i-g-t v5 1/4] lib/igt_sysfs: Add support to query number of tiles Himal Prasad Ghimiray
2023-07-05  8:52 ` [igt-dev] [PATCH i-g-t v5 2/4] lib/igt_sysfs: Handling gt related sysfs uapi changes Himal Prasad Ghimiray
2023-07-05  8:52 ` [igt-dev] [PATCH i-g-t v5 3/4] tests/xe/xe_guc_pc: Change the sysfs paths Himal Prasad Ghimiray
2023-07-06  0:12   ` Dixit, Ashutosh
2023-07-06  3:20     ` Ghimiray, Himal Prasad
2023-07-06  3:52       ` Dixit, Ashutosh [this message]
2023-07-06  4:10         ` Ghimiray, Himal Prasad
2023-07-05  8:52 ` [igt-dev] [PATCH i-g-t v5 4/4] tests/xe/xe_sysfs_tile_prop: adds new test to verify per tile vram addr_range Himal Prasad Ghimiray
2023-07-05  9:14 ` [igt-dev] [PATCH i-g-t v5 0/4] Handle GT and tile seperation in IGT Kumar, Janga Rahul
2023-07-05  9:18   ` Ghimiray, Himal Prasad
2023-07-06 16:26     ` Kumar, Janga Rahul
2023-07-05 10:18 ` [igt-dev] ✓ Fi.CI.BAT: success for Handle GT and tile seperation in IGT (rev4) Patchwork
2023-07-05 12:05 ` [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=87jzvdd7da.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox