* [PATCH] drm/amdkfd: Fix getting unique_id in topology
@ 2020-10-28 17:11 Kent Russell
2020-10-28 17:43 ` Felix Kuehling
0 siblings, 1 reply; 2+ messages in thread
From: Kent Russell @ 2020-10-28 17:11 UTC (permalink / raw)
To: amd-gfx; +Cc: Kent Russell
Since the unique_id is now obtained in amdgpu in smu_late_init,
topology misses getting the value during KFD device initialization.
To work around this, we use amdgpu_amdkfd_get_unique_id to get
the unique_id at read time. Due to this, we can remove unique_id from
the kfd_dev structure, since we only need it in the KFD node properties
struct
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 --
drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 ---
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +-
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 14c3f148735b..50922ff2927b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -757,8 +757,6 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
kfd->hive_id = amdgpu_amdkfd_get_hive_id(kfd->kgd);
- kfd->unique_id = amdgpu_amdkfd_get_unique_id(kfd->kgd);
-
kfd->noretry = amdgpu_amdkfd_get_noretry(kfd->kgd);
if (kfd_interrupt_init(kfd)) {
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index b7be5c5751b7..e2ebd5a1d4de 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -292,9 +292,6 @@ struct kfd_dev {
/* xGMI */
uint64_t hive_id;
- /* UUID */
- uint64_t unique_id;
-
bool pci_atomic_requested;
/* Use IOMMU v2 flag */
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index 3f2aa055c32c..a3fc23873819 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -1340,7 +1340,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
dev->gpu->dqm->sched_policy != KFD_SCHED_POLICY_NO_HWS) ?
amdgpu_amdkfd_get_num_gws(dev->gpu->kgd) : 0;
dev->node_props.num_cp_queues = get_cp_queues_num(dev->gpu->dqm);
- dev->node_props.unique_id = gpu->unique_id;
+ dev->node_props.unique_id = amdgpu_amdkfd_get_unique_id(dev->gpu->kgd);
kfd_fill_mem_clk_max_info(dev);
kfd_fill_iolink_non_crat_info(dev);
--
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] 2+ messages in thread
* Re: [PATCH] drm/amdkfd: Fix getting unique_id in topology
2020-10-28 17:11 [PATCH] drm/amdkfd: Fix getting unique_id in topology Kent Russell
@ 2020-10-28 17:43 ` Felix Kuehling
0 siblings, 0 replies; 2+ messages in thread
From: Felix Kuehling @ 2020-10-28 17:43 UTC (permalink / raw)
To: Kent Russell, amd-gfx
Am 2020-10-28 um 1:11 p.m. schrieb Kent Russell:
> Since the unique_id is now obtained in amdgpu in smu_late_init,
> topology misses getting the value during KFD device initialization.
> To work around this, we use amdgpu_amdkfd_get_unique_id to get
> the unique_id at read time. Due to this, we can remove unique_id from
> the kfd_dev structure, since we only need it in the KFD node properties
> struct
>
> Signed-off-by: Kent Russell <kent.russell@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 --
> drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 ---
> drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +-
> 3 files changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> index 14c3f148735b..50922ff2927b 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> @@ -757,8 +757,6 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
>
> kfd->hive_id = amdgpu_amdkfd_get_hive_id(kfd->kgd);
>
> - kfd->unique_id = amdgpu_amdkfd_get_unique_id(kfd->kgd);
> -
> kfd->noretry = amdgpu_amdkfd_get_noretry(kfd->kgd);
>
> if (kfd_interrupt_init(kfd)) {
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> index b7be5c5751b7..e2ebd5a1d4de 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> @@ -292,9 +292,6 @@ struct kfd_dev {
> /* xGMI */
> uint64_t hive_id;
>
> - /* UUID */
> - uint64_t unique_id;
> -
> bool pci_atomic_requested;
>
> /* Use IOMMU v2 flag */
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> index 3f2aa055c32c..a3fc23873819 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> @@ -1340,7 +1340,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
> dev->gpu->dqm->sched_policy != KFD_SCHED_POLICY_NO_HWS) ?
> amdgpu_amdkfd_get_num_gws(dev->gpu->kgd) : 0;
> dev->node_props.num_cp_queues = get_cp_queues_num(dev->gpu->dqm);
> - dev->node_props.unique_id = gpu->unique_id;
> + dev->node_props.unique_id = amdgpu_amdkfd_get_unique_id(dev->gpu->kgd);
>
> kfd_fill_mem_clk_max_info(dev);
> kfd_fill_iolink_non_crat_info(dev);
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-28 17:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-28 17:11 [PATCH] drm/amdkfd: Fix getting unique_id in topology Kent Russell
2020-10-28 17:43 ` Felix Kuehling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox