drm/amdkfd: fix incorrect condition check for pci atomics gpu flags
Subsystems (3)
PATCH 1/1 drm/amdkfd: fix incorrect condition check for pci atomics gpu flags
As pci_atomics_device_to_root check is a host to device support check, the device xgmi hive setup status is irrelevant to setting the NO_ATOMICS gpu flags so move it under the correct host-device check condition.
--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0 -2
@@ -1206,23 +1206,21 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) adev = (struct amdgpu_device *)(dev->gpu->kgd);if (!adev->gmc.xgmi.connected_to_cpu) {pcie_capability_read_dword (dev->gpu->pdev,PCI_EXP_DEVCAP2 , &cap);if (!(cap & (PCI_EXP_DEVCAP2_ATOMIC_COMP32 |PCI_EXP_DEVCAP2_ATOMIC_COMP64 ))) cpu_flag |=CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT |CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; - } -if (!adev->gmc.xgmi.num_physical_nodes) {if (!dev->gpu->pci_atomic_requested || dev->gpu->device_info->asic_family ==CHIP_HAWAII ) flag |=CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT |CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; }/* GPU only creates direct links so apply flags setting to all */ list_for_each_entry (link, &dev->io_link_props, list) { link->flags = flag;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Felix Kuehling
maintainerAm 2021-04-30 um 4:51 p.m. schrieb Jonathan Kim:
Quoted 3 lines
As
pci_atomics_device_to_rootcheck is a host to device support check, the device xgmi hive setup status is irrelevant to setting theNO_ATOMICSgpu flags so move it under the correct host-device check condition.
I think that's still not quite correct. The flag is applied to all direct outgoing links from the GPU. That includes the link to the CPU and the links to other GPUs in the XGMI hive. Technically we may want different flags for different types of links.
I think this whole function is just completely broken for systems with XGMI because it doesn't make that distinction.
Maybe instead of looking at adev->gmc.xgmi.connected_to_cpu, look at link->iolink_type inside the loop. If it's CRAT_IOLINK_TYPE_PCIEXPRESS, you apply the NO_ATOMIC flags as appropriate. If it's CRAT_IOLINK_TYPE_XGMI, you can skip it, because XGMI is assumed to always support atomics. This would fix A+A as well as normal XGMI between GPUs at once.
Regards,
Felix
Quoted 24 lines
Signed-off-by Jonathan Kim <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-2@@ -1206,23 +1206,21 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) adev = (struct amdgpu_device *)(dev->gpu->kgd);if (!adev->gmc.xgmi.connected_to_cpu) {pcie_capability_read_dword (dev->gpu->pdev,PCI_EXP_DEVCAP2 , &cap);if (!(cap & (PCI_EXP_DEVCAP2_ATOMIC_COMP32 |PCI_EXP_DEVCAP2_ATOMIC_COMP64 ))) cpu_flag |=CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT |CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; - } -if (!adev->gmc.xgmi.num_physical_nodes) {
drivers/gpu/drm/amd/amdkfd/kfd_topology.c static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) · line 1226
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-0if (!dev->gpu->pci_atomic_requested || dev->gpu->device_info->asic_family ==CHIP_HAWAII ) flag |=CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT |CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; }/* GPU only creates direct links so apply flags setting to all */ list_for_each_entry (link, &dev->io_link_props, list) { link->flags = flag;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx