Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>,
	Brian Welty <brian.welty@intel.com>
Cc: intel-xe@lists.freedesktop.org, vivi.rodrigo@intel.com
Subject: Re: [Intel-xe] [RFC 2/4] drm/xe: Add memory directory for vram attributes
Date: Fri, 17 Nov 2023 16:37:34 -0500	[thread overview]
Message-ID: <ZVfdHp1M0BPtn457@intel.com> (raw)
In-Reply-To: <20231116143043.908412-3-sujaritha.sundaresan@intel.com>

On Thu, Nov 16, 2023 at 08:00:41PM +0530, Sujaritha Sundaresan wrote:
> Adding a new "memory" directory under for vram attributes
> under the exisiting tile<n> directory.
> 
> Signed-off-by: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>

Cc: Brian Welty <brian.welty@intel.com>

Brian, should this directory be under the tile, or maybe we create
separated xe_vram_sysfs components for 

/sys/..../device/vram<n>

and then if it makes sense inside the tile we just have a symbolic
link between them?

Or better for now go with what Suja suggested and then later adjust
with symbolic links if needed?

> ---
>  drivers/gpu/drm/xe/xe_tile_sysfs.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_tile_sysfs.c b/drivers/gpu/drm/xe/xe_tile_sysfs.c
> index 16376607c68f..d61c6fb1df40 100644
> --- a/drivers/gpu/drm/xe/xe_tile_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_tile_sysfs.c
> @@ -46,6 +46,7 @@ void xe_tile_sysfs_init(struct xe_tile *tile)
>  	struct xe_device *xe = tile_to_xe(tile);
>  	struct device *dev = xe->drm.dev;
>  	struct kobj_tile *kt;
> +	struct kobject *kobj;
>  	int err;
>  
>  	kt = kzalloc(sizeof(*kt), GFP_KERNEL);
> @@ -64,8 +65,14 @@ void xe_tile_sysfs_init(struct xe_tile *tile)
>  
>  	tile->sysfs = &kt->base;
>  
> +	kobj = kobject_create_and_add("memory", tile->sysfs);
> +	if (!kobj) {
> +		drm_warn(&xe->drm, "%s failed, err: %d\n", __func__, -ENOMEM);
> +		return;
> +	}
> +
>  	if (IS_DGFX(xe) && xe->info.platform != XE_DG1 &&
> -	    sysfs_create_file(tile->sysfs, physical_memsize_attr))
> +	    sysfs_create_file(kobj, physical_memsize_attr))
>  		drm_warn(&xe->drm,
>  			 "Sysfs creation to read addr_range per tile failed\n");
>  
> -- 
> 2.25.1
> 

  reply	other threads:[~2023-11-17 21:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 14:30 [Intel-xe] [RFC 0/4] Adding new frequency sysfs attributes Sujaritha Sundaresan
2023-11-16 14:20 ` [Intel-xe] ✗ CI.Patch_applied: failure for " Patchwork
2023-11-16 14:30 ` [Intel-xe] [RFC 1/4] drm/xe: Moving and renaming existing " Sujaritha Sundaresan
2023-11-21  4:12   ` Dixit, Ashutosh
2023-11-21  4:50   ` Riana Tauro
2023-11-21  4:58     ` Dixit, Ashutosh
2023-11-22  8:25       ` Sundaresan, Sujaritha
2023-11-22 14:32         ` Gupta, Anshuman
2023-11-16 14:30 ` [Intel-xe] [RFC 2/4] drm/xe: Add memory directory for vram attributes Sujaritha Sundaresan
2023-11-17 21:37   ` Rodrigo Vivi [this message]
2023-11-18  1:25     ` Welty, Brian
2023-11-22  8:36       ` Sundaresan, Sujaritha
2023-11-22  8:37       ` Sundaresan, Sujaritha
2023-11-16 14:30 ` [Intel-xe] [RFC 3/4] drm/xe: Add throttle reasons sysfs attributes Sujaritha Sundaresan
2023-11-17 21:41   ` Rodrigo Vivi
2023-11-20  3:33     ` Sundaresan, Sujaritha
2023-11-22  8:33     ` Sundaresan, Sujaritha
2023-11-16 14:30 ` [Intel-xe] [RFC 4/4] drm/xe: Add vram frequency " Sujaritha Sundaresan
2023-11-17 21:43   ` Rodrigo Vivi
2023-11-18  2:24 ` [Intel-xe] ✓ CI.Patch_applied: success for Adding new " Patchwork
2023-11-18  2:24 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-11-18  2:25 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-11-18  2:32 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-11-18  2:33 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-11-18  2:34 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-11-18  3:12 ` [Intel-xe] ✗ CI.BAT: 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=ZVfdHp1M0BPtn457@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=brian.welty@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sujaritha.sundaresan@intel.com \
    --cc=vivi.rodrigo@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