All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdkfd: Print unique_id as hex instead of decimal
@ 2021-02-03 18:22 Kent Russell
  2021-02-03 18:37 ` Felix Kuehling
  0 siblings, 1 reply; 3+ messages in thread
From: Kent Russell @ 2021-02-03 18:22 UTC (permalink / raw)
  To: amd-gfx; +Cc: Kent Russell

Add a new helper function for printing Topology values to support
printing 64-bit hex values. Use this for unique_id to ensure that the
unique_id in KFD's topology matches the one in amdgpu's sysfs pool.

Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index a3fc23873819..4e4f651dcb88 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -217,6 +217,8 @@ struct kfd_topology_device *kfd_create_topology_device(
 		sysfs_show_gen_prop(buffer, offs, "%s %u\n", name, value)
 #define sysfs_show_64bit_prop(buffer, offs, name, value) \
 		sysfs_show_gen_prop(buffer, offs, "%s %llu\n", name, value)
+#define sysfs_show_64bit_hex_prop(buffer, offs, name, value) \
+		sysfs_show_gen_prop(buffer, offs, "%s %llx\n", name, value)
 #define sysfs_show_32bit_val(buffer, offs, value) \
 		sysfs_show_gen_prop(buffer, offs, "%u\n", value)
 #define sysfs_show_str_val(buffer, offs, value) \
@@ -497,7 +499,7 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
 			      dev->node_props.num_sdma_queues_per_engine);
 	sysfs_show_32bit_prop(buffer, offs, "num_cp_queues",
 			      dev->node_props.num_cp_queues);
-	sysfs_show_64bit_prop(buffer, offs, "unique_id",
+	sysfs_show_64bit_hex_prop(buffer, offs, "unique_id",
 			      dev->node_props.unique_id);
 
 	if (dev->gpu) {
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdkfd: Print unique_id as hex instead of decimal
  2021-02-03 18:22 [PATCH] drm/amdkfd: Print unique_id as hex instead of decimal Kent Russell
@ 2021-02-03 18:37 ` Felix Kuehling
  2021-02-03 18:43   ` Russell, Kent
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Kuehling @ 2021-02-03 18:37 UTC (permalink / raw)
  To: Kent Russell, amd-gfx

Doesn't this break the ABI?

Am 2021-02-03 um 1:22 p.m. schrieb Kent Russell:
> Add a new helper function for printing Topology values to support
> printing 64-bit hex values. Use this for unique_id to ensure that the
> unique_id in KFD's topology matches the one in amdgpu's sysfs pool.
>
> Signed-off-by: Kent Russell <kent.russell@amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> index a3fc23873819..4e4f651dcb88 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> @@ -217,6 +217,8 @@ struct kfd_topology_device *kfd_create_topology_device(
>  		sysfs_show_gen_prop(buffer, offs, "%s %u\n", name, value)
>  #define sysfs_show_64bit_prop(buffer, offs, name, value) \
>  		sysfs_show_gen_prop(buffer, offs, "%s %llu\n", name, value)
> +#define sysfs_show_64bit_hex_prop(buffer, offs, name, value) \
> +		sysfs_show_gen_prop(buffer, offs, "%s %llx\n", name, value)
>  #define sysfs_show_32bit_val(buffer, offs, value) \
>  		sysfs_show_gen_prop(buffer, offs, "%u\n", value)
>  #define sysfs_show_str_val(buffer, offs, value) \
> @@ -497,7 +499,7 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
>  			      dev->node_props.num_sdma_queues_per_engine);
>  	sysfs_show_32bit_prop(buffer, offs, "num_cp_queues",
>  			      dev->node_props.num_cp_queues);
> -	sysfs_show_64bit_prop(buffer, offs, "unique_id",
> +	sysfs_show_64bit_hex_prop(buffer, offs, "unique_id",
>  			      dev->node_props.unique_id);
>  
>  	if (dev->gpu) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amdkfd: Print unique_id as hex instead of decimal
  2021-02-03 18:37 ` Felix Kuehling
@ 2021-02-03 18:43   ` Russell, Kent
  0 siblings, 0 replies; 3+ messages in thread
From: Russell, Kent @ 2021-02-03 18:43 UTC (permalink / raw)
  To: Kuehling, Felix, amd-gfx

[AMD Public Use]

Indeed it will. Consider this dropped, as no one was asking for it anyways. 

 Kent

> -----Original Message-----
> From: Kuehling, Felix <Felix.Kuehling@amd.com>
> Sent: Wednesday, February 3, 2021 1:38 PM
> To: Russell, Kent <Kent.Russell@amd.com>; amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/amdkfd: Print unique_id as hex instead of decimal
> 
> Doesn't this break the ABI?
> 
> Am 2021-02-03 um 1:22 p.m. schrieb Kent Russell:
> > Add a new helper function for printing Topology values to support
> > printing 64-bit hex values. Use this for unique_id to ensure that the
> > unique_id in KFD's topology matches the one in amdgpu's sysfs pool.
> >
> > Signed-off-by: Kent Russell <kent.russell@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> > index a3fc23873819..4e4f651dcb88 100644
> > --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> > @@ -217,6 +217,8 @@ struct kfd_topology_device *kfd_create_topology_device(
> >  		sysfs_show_gen_prop(buffer, offs, "%s %u\n", name, value)
> >  #define sysfs_show_64bit_prop(buffer, offs, name, value) \
> >  		sysfs_show_gen_prop(buffer, offs, "%s %llu\n", name, value)
> > +#define sysfs_show_64bit_hex_prop(buffer, offs, name, value) \
> > +		sysfs_show_gen_prop(buffer, offs, "%s %llx\n", name, value)
> >  #define sysfs_show_32bit_val(buffer, offs, value) \
> >  		sysfs_show_gen_prop(buffer, offs, "%u\n", value)
> >  #define sysfs_show_str_val(buffer, offs, value) \
> > @@ -497,7 +499,7 @@ static ssize_t node_show(struct kobject *kobj, struct attribute
> *attr,
> >  			      dev->node_props.num_sdma_queues_per_engine);
> >  	sysfs_show_32bit_prop(buffer, offs, "num_cp_queues",
> >  			      dev->node_props.num_cp_queues);
> > -	sysfs_show_64bit_prop(buffer, offs, "unique_id",
> > +	sysfs_show_64bit_hex_prop(buffer, offs, "unique_id",
> >  			      dev->node_props.unique_id);
> >
> >  	if (dev->gpu) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-03 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 18:22 [PATCH] drm/amdkfd: Print unique_id as hex instead of decimal Kent Russell
2021-02-03 18:37 ` Felix Kuehling
2021-02-03 18:43   ` Russell, Kent

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.