drm/amdkfd: Add node_id to location_id generically
authorLijo Lazar <lijo.lazar@amd.com>
Wed, 7 Aug 2024 16:11:59 +0000 (21:41 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 Aug 2024 16:12:52 +0000 (12:12 -0400)
If there are multiple nodes per kfd device, add nodeid to location_id to
differentiate.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c

index 27d452e50ca99f8fa50e70c781219aa8384900fb..3871591c9aec98d6a5cb4d07a802fc3962899860 100644 (file)
@@ -2078,7 +2078,7 @@ int kfd_topology_add_device(struct kfd_node *gpu)
                        HSA_CAP_ASIC_REVISION_MASK);
 
        dev->node_props.location_id = pci_dev_id(gpu->adev->pdev);
-       if (KFD_GC_VERSION(dev->gpu->kfd) == IP_VERSION(9, 4, 3))
+       if (gpu->kfd->num_nodes > 1)
                dev->node_props.location_id |= dev->gpu->node_id;
 
        dev->node_props.domain = pci_domain_nr(gpu->adev->pdev->bus);