drm/amdkfd: Add domain number into gpu_id
authorAmber Lin <Amber.Lin@amd.com>
Thu, 14 Feb 2019 21:02:26 +0000 (16:02 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:21:03 +0000 (12:21 -0500)
A multi-socket server can have multiple PCIe segments so BFD is not enough
to distingush each GPU. Also add domain number into account when generating
gpu_id.

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c

index 478b5daace4b36b311964315d7169c8098e41978..592cc6acffd915248c7e16176736024051fb5394 100644 (file)
@@ -1082,8 +1082,9 @@ static uint32_t kfd_generate_gpu_id(struct kfd_dev *gpu)
                        local_mem_info.local_mem_size_public;
 
        buf[0] = gpu->pdev->devfn;
-       buf[1] = gpu->pdev->subsystem_vendor;
-       buf[2] = gpu->pdev->subsystem_device;
+       buf[1] = gpu->pdev->subsystem_vendor |
+               (gpu->pdev->subsystem_device << 16);
+       buf[2] = pci_domain_nr(gpu->pdev->bus);
        buf[3] = gpu->pdev->device;
        buf[4] = gpu->pdev->bus->number;
        buf[5] = lower_32_bits(local_mem_size);