drm/amdkfd: report atomics support in io_links over xgmi
Subsystems (3)
PATCH 1/1 drm/amdkfd: report atomics support in io_links over xgmi
Link atomics support over xGMI should be reported independently of PCIe.
--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +18 -11
@@ -1196,6 +1196,7 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) {struct kfd_iolink_properties *link, *cpu_link;struct kfd_topology_device *cpu_dev; +struct amdgpu_device *adev;uint32_t cap;uint32_t cpu_flag =CRAT_IOLINK_FLAGS_ENABLED ;uint32_t flag =CRAT_IOLINK_FLAGS_ENABLED ;
@@ -1203,18 +1204,24 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)if (!dev || !dev->gpu)return ; -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 ; + 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 (!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 ; +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) {
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-29 um 5:36 a.m. schrieb Jonathan Kim:
Quoted 1 line
Link atomics support over xGMI should be reported independently of PCIe.
I don't understand this change. I don't see any code that gets executed if (adev->gmc.xgmi.connected_to_cpu). Where is the code that reports atomics support for this case?
Also, the PCIe code doesn't clear any atomic flags. It only sets flags that would be set for XGMI anyway. So I don't see why you need to make that code conditional.
Regards,
Felix
Quoted 45 lines
Signed-off-by Jonathan Kim <[email protected]>Tested-by Ramesh Errabolu <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +11
-11@@ -1196,6 +1196,7 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) {struct kfd_iolink_properties *link, *cpu_link;struct kfd_topology_device *cpu_dev; +struct amdgpu_device *adev;uint32_t cap;uint32_t cpu_flag =CRAT_IOLINK_FLAGS_ENABLED ;uint32_t flag =CRAT_IOLINK_FLAGS_ENABLED ;@@ -1203,18 +1204,24 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)if (!dev || !dev->gpu)return ; -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 ; + 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 (!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 ;
drivers/gpu/drm/amd/amdkfd/kfd_topology.c static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) · line 1227
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +7
-0+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) {
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
Quoted 10 lines
-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Thursday, April 29, 2021 10:49 AM
To: Kim, Jonathan <[email protected]>; amd- [email protected]
Cc: Zeng, Oak <[email protected]>; Errabolu, Ramesh <[email protected]>
Subject: Re: [PATCH] drm/amdkfd: report atomics support inio_linksover xgmi
Quoted 6 lines
Am 2021-04-29 um 5:36 a.m. schrieb Jonathan Kim:
Quoted 1 line
Link atomics support over xGMI should be reported independently of PCIe.
I don't understand this change. I don't see any code that gets executed if (
adev->gmc.xgmi.connected_to_cpu). Where is the code that reports atomics support for this case?
The atomics aren't set but rather NO_ATOMICS are set if non-xgmi and non PCIe supported:cpu_flag |= CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT | CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT; adev->gmc.xgmi.connected_to_cpu == true would bypass this flag NO_ATOMICS setting.
Quoted 4 lines
Also, the PCIe code doesn't clear any atomic flags. It only sets flags that would be set for XGMI anyway. So I don't see why you need to make that code conditional.
As mentioned above they set NO_ATOMICS if not PCIe supported. This has been observed on Aldebaran with AMD systems.
Thanks,
Jon
Quoted 62 lines
Regards,
FelixQuoted 14 lines
Signed-off-by Jonathan Kim <[email protected]>Tested-by Ramesh Errabolu <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-0drivers/gpu/drm/amd/amdkfd/kfd_topology.c static void kfd_fill_iolink_non_crat_info(struct · line 1202
Quoted 7 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1
-0@@ -1196,6 +1196,7 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) {struct kfd_iolink_properties *link, *cpu_link;struct kfd_topology_device *cpu_dev; +struct amdgpu_device *adev;uint32_t cap;uint32_t cpu_flag =CRAT_IOLINK_FLAGS_ENABLED ; uint32_t flag = CRAT_IOLINK_FLAGS_ENABLED; @@ -1203,18+1204,24 @@
Quoted 9 lines
static void
kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
if (!dev || !dev->gpu)
return;drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-5-pcie_capability_read_dword (dev->gpu->pdev, -PCI_EXP_DEVCAP2 , &cap); - -if (!(cap & (PCI_EXP_DEVCAP2_ATOMIC_COMP32 | -PCI_EXP_DEVCAP2_ATOMIC_COMP64 )))drivers/gpu/drm/amd/amdkfd/kfd_topology.c static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +8
-2-cpu_flag |=CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT | -CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; +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|Quoted 15 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +9
-4+CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; +} -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 ; +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 ; +}
Quoted 2 lines
Quoted 2 lines
/* GPU only creates direct links so apply flags setting to all */
list_for_each_entry(link, &dev->io_link_props, list){
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 2021-04-29 um 11:04 a.m. schrieb Kim, Jonathan:
Quoted 21 lines
[AMD Official Use Only - Internal Distribution Only]
Quoted 10 lines
-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Thursday, April 29, 2021 10:49 AM
To: Kim, Jonathan <[email protected]>; amd- [email protected]
Cc: Zeng, Oak <[email protected]>; Errabolu, Ramesh <[email protected]>
Subject: Re: [PATCH] drm/amdkfd: report atomics support inio_linksover xgmiQuoted 5 lines
Am 2021-04-29 um 5:36 a.m. schrieb Jonathan Kim:
Quoted 1 line
Link atomics support over xGMI should be reported independently of PCIe.
I don't understand this change. I don't see any code that gets executed if (
adev->gmc.xgmi.connected_to_cpu). Where is the code that reports atomics support for this case?The atomics aren't set but rather
NO_ATOMICSare set if non-xgmi and non PCIe supported:cpu_flag|=CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT|CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT;adev->gmc.xgmi.connected_to_cpu== true would bypass this flagNO_ATOMICSsetting.
Quoted 5 lines
Quoted 3 lines
Also, the PCIe code doesn't clear any atomic flags. It only sets flags that would be set for XGMI anyway. So I don't see why you need to make that code conditional.
As mentioned above they set
NO_ATOMICSif not PCIe supported. This has been observed on Aldebaran with AMD systems.
OK. I missed that these flags are negative logic. Thanks, the change makes sense now. But the patch description is a bit misleading compared to the code. A different wording would make it clearer, e.g.: "Don't set NO_ATOMICS flags on XGMI links between CPU and GPU."
With that fixed, the patch is
Regards,
Felix
Quoted 65 lines
Thanks,
Jon
Quoted 60 lines
Regards,
FelixQuoted 13 lines
Signed-off-by Jonathan Kim <[email protected]>Tested-by Ramesh Errabolu <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-0drivers/gpu/drm/amd/amdkfd/kfd_topology.c static void kfd_fill_iolink_non_crat_info(struct · line 1202
Quoted 7 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1
-0@@ -1196,6 +1196,7 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) {struct kfd_iolink_properties *link, *cpu_link;struct kfd_topology_device *cpu_dev; +struct amdgpu_device *adev;uint32_t cap;uint32_t cpu_flag =CRAT_IOLINK_FLAGS_ENABLED ; uint32_t flag = CRAT_IOLINK_FLAGS_ENABLED; @@ -1203,18+1204,24 @@
Quoted 9 lines
static void
kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
if (!dev || !dev->gpu)
return;drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-5-pcie_capability_read_dword (dev->gpu->pdev, -PCI_EXP_DEVCAP2 , &cap); - -if (!(cap & (PCI_EXP_DEVCAP2_ATOMIC_COMP32 | -PCI_EXP_DEVCAP2_ATOMIC_COMP64 )))drivers/gpu/drm/amd/amdkfd/kfd_topology.c static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +8
-2-cpu_flag |=CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT | -CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; +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|Quoted 15 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +9
-4+CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; +} -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 ; +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 ; +}
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
/* GPU only creates direct links so apply flags setting to all */
list_for_each_entry(link, &dev->io_link_props, list){
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
Quoted 39 lines
-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Thursday, April 29, 2021 11:18 AM
To: Kim, Jonathan <[email protected]>; amd- [email protected]
Cc: Zeng, Oak <[email protected]>; Errabolu, Ramesh <[email protected]>
Subject: Re: [PATCH] drm/amdkfd: report atomics support inio_linksover xgmiAm 2021-04-29 um 11:04 a.m. schrieb Kim, Jonathan:
Quoted 14 lines
[AMD Official Use Only - Internal Distribution Only]
Quoted 12 lines
-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Thursday, April 29, 2021 10:49 AM
To: Kim, Jonathan <[email protected]>; amd- [email protected]
Cc: Zeng, Oak <[email protected]>; Errabolu, Ramesh <[email protected]>
Subject: Re: [PATCH] drm/amdkfd: report atomics support inio_linksover xgmiAm 2021-04-29 um 5:36 a.m. schrieb Jonathan Kim:
Quoted 1 line
Link atomics support over xGMI should be reported independently of
PCIe.
Quoted 4 lines
Quoted 3 lines
I don't understand this change. I don't see any code that gets executed if (
adev->gmc.xgmi.connected_to_cpu). Where is the code that reports atomics support for this case?The atomics aren't set but rather
NO_ATOMICSare set if non-xgmi and nonPCIe supported:
Quoted 3 lines
cpu_flag|=CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT|CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT;adev->gmc.xgmi.connected_to_cpu== true would bypass this flag
NO_ATOMICSsetting.Quoted 4 lines
Quoted 4 lines
Also, the PCIe code doesn't clear any atomic flags. It only sets flags that would be set for XGMI anyway. So I don't see why you need to make that code conditional.
Quoted 7 lines
Quoted 2 lines
As mentioned above they set
NO_ATOMICSif not PCIe supported. This has been observed on Aldebaran with AMD systems.OK. I missed that these flags are negative logic. Thanks, the change makes sense now. But the patch description is a bit misleading compared to the code. A different wording would make it clearer, e.g.: "Don't set
NO_ATOMICSflags on XGMI links between CPU and GPU."
Thanks for the review Felix. Will do.
Jon
Quoted 73 lines
With that fixed, the patch is
Reviewed-by Felix Kuehling <[email protected]>Regards,
FelixQuoted 64 lines
Thanks,
Jon
Quoted 59 lines
Regards,
FelixQuoted 13 lines
Signed-off-by Jonathan Kim <[email protected]>Tested-by Ramesh Errabolu <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-0@@ -1196,6 +1196,7 @@ static voidQuoted 8 lines
kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev){
structkfd_iolink_properties*link,*cpu_link; structkfd_topology_device*cpu_dev;
+structamdgpu_device*adev;
uint32_tcap;
uint32_tcpu_flag=CRAT_IOLINK_FLAGS_ENABLED;uint32_tflag =CRAT_IOLINK_FLAGS_ENABLED; @@ -1203,18+1204,24 @@
Quoted 7 lines
static void
kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)if (!dev || !dev->gpu) return;drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-4-pcie_capability_read_dword (dev->gpu->pdev, -PCI_EXP_DEVCAP2 , &cap); - -if (!(cap & (PCI_EXP_DEVCAP2_ATOMIC_COMP32 |drivers/gpu/drm/amd/amdkfd/kfd_topology.c static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +7
-3- PCI_EXP_DEVCAP2_ATOMIC_COMP64))) -cpu_flag |= CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT | -CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; +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|Quoted 15 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +9
-4+CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT ; +} -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 ; +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 ; +}
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
/* GPU only creates direct links so apply flags setting to all */
list_for_each_entry(link, &dev->io_link_props, list){
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
I think part of this can be done more clean in amdgpu_device_init:
r = 0;
If (!adev->gmc.xgmi.connected_to_cpu)
/* enable PCIE atomic ops */
r = pci_enable_atomic_ops_to_root(adev->pdev,
PCI_EXP_DEVCAP2_ATOMIC_COMP32 |
PCI_EXP_DEVCAP2_ATOMIC_COMP64);
if (r) {
adev->have_atomics_support = false;
DRM_INFO("PCIE atomic ops is not supported\n");
} else {
adev->have_atomics_support = true;
}Regards,
Oak
On 2021-04-29, 5:36 AM, "Kim, Jonathan" <[email protected]> wrote:
Link atomics support over xGMI should be reported independently of PCIe.
Signed-off-by: Jonathan Kim <[email protected]>
Tested-by: Ramesh Errabolu <[email protected]>
---
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++---------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index 083ac9babfa8..30430aefcfc7 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -1196,6 +1196,7 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
{
struct kfd_iolink_properties *link, *cpu_link;
struct kfd_topology_device *cpu_dev;
+ struct amdgpu_device *adev;
uint32_t cap;
uint32_t cpu_flag = CRAT_IOLINK_FLAGS_ENABLED;
uint32_t flag = CRAT_IOLINK_FLAGS_ENABLED;
@@ -1203,18 +1204,24 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
if (!dev || !dev->gpu)
return;
- 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;
+ 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 (!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;
+ 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) {
--
2.17.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Felix Kuehling
maintainerAm 2021-04-29 um 9:12 p.m. schrieb Zeng, Oak:
Quoted 14 lines
I think part of this can be done more clean in
amdgpu_device_init:r = 0; If (!adev->gmc.xgmi.connected_to_cpu) /* enable PCIE atomic ops */ r = pci_enable_atomic_ops_to_root(adev->pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP32 | PCI_EXP_DEVCAP2_ATOMIC_COMP64); if (r) { adev->have_atomics_support = false; DRM_INFO("PCIE atomic ops is not supported\n"); } else { adev->have_atomics_support = true; }
This code is already in amdgpu_device_init. I'm not sure what's your point. Are you suggesting that the topology flags should be updated in amdgpu_device_init? That's not really possible because the KFD topology data structures don't exist at that time (they do only after the call to amdgpu_device_ip_init) and the data structures are not known in amdgpu_device.c. It's cleaner to keep this compartmentalized in kfd_topology.c.
Regards,
Felix
Quoted 57 lines
Regards,
OakOn 2021-04-29, 5:36 AM, "Kim, Jonathan" <[email protected]> wrote:
Link atomics support over xGMI should be reported independently of PCIe. Signed-off-by: Jonathan Kim <[email protected]> Tested-by: Ramesh Errabolu <[email protected]> --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 083ac9babfa8..30430aefcfc7 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -1196,6 +1196,7 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) { struct kfd_iolink_properties *link, *cpu_link; struct kfd_topology_device *cpu_dev; + struct amdgpu_device *adev; uint32_t cap; uint32_t cpu_flag = CRAT_IOLINK_FLAGS_ENABLED; uint32_t flag = CRAT_IOLINK_FLAGS_ENABLED; @@ -1203,18 +1204,24 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) if (!dev || !dev->gpu) return; - 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; + 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 (!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; + if (!adev->gmc.xgmi.num_physical_nodes) { + if (!dev->gpu->pci_atomic_requested || + dev->gpu->device_info->asic_family == + CHIP_HAWAII)
Quoted 10 lines
+ 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) {
--
2.17.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Sorry I should be clearer.
dev->gpu->pci_atomic_requested is set to the value of adev->have_atomics_support - see function amdgpu_amdkfd_have_atomics_support. adev->have_atomics_support is set through function pci_enable_atomic_ops_to_root currently in amdgpu_device_init - I don't think this logic is correct for xgmi connected devices. For xgmi connected devices, adev->have_atomics_support should always set to true. +@Cornwall, Jay to comment as the original author of this codes.
The codes Jon put below refers dev->gpu->pci_atomic_requested to set the io link properties. I think we should fix adev->have_atomics_support which is the source of dev->gpu->pci_atomic_requested. Once adev->have_atomics_support is fixed, part of the code in kfd_topology.c doesn't need to be changed. Currently kfd_topology.c is the only consumer of adev->have_atomics_support and seems we only use such information for gpu-gpu io-link not for gpu-cpu iolink properties. But I still think we fix it from the source is better because in the future there might be code refers to adev->have_atomics_support. The code I put below is wrong though, it should be:
If (!adev->gmc.xgmi.num_physical_nodes)
r = pci_enable_atomic_ops_to_root(adev->pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP32 | PCI_EXP_DEVCAP2_ATOMIC_COMP64);
Regards,
Oak
On 2021-04-29, 10:45 PM, "Kuehling, Felix" <[email protected]> wrote:
Am 2021-04-29 um 9:12 p.m. schrieb Zeng, Oak:
> I think part of this can be done more clean in amdgpu_device_init:
>
> r = 0;
> If (!adev->gmc.xgmi.connected_to_cpu)
> /* enable PCIE atomic ops */
> r = pci_enable_atomic_ops_to_root(adev->pdev,
> PCI_EXP_DEVCAP2_ATOMIC_COMP32 |
> PCI_EXP_DEVCAP2_ATOMIC_COMP64);
> if (r) {
> adev->have_atomics_support = false;
> DRM_INFO("PCIE atomic ops is not supported\n");
> } else {
> adev->have_atomics_support = true;
> }
This code is already in amdgpu_device_init. I'm not sure what's your
point. Are you suggesting that the topology flags should be updated in
amdgpu_device_init? That's not really possible because the KFD topology
data structures don't exist at that time (they do only after the call to
amdgpu_device_ip_init) and the data structures are not known in
amdgpu_device.c. It's cleaner to keep this compartmentalized in
kfd_topology.c.
Regards,
Felix
> Regards,
> Oak
>
>
>
> On 2021-04-29, 5:36 AM, "Kim, Jonathan" <[email protected]> wrote:
>
> Link atomics support over xGMI should be reported independently of PCIe.
>
> Signed-off-by: Jonathan Kim <[email protected]>
> Tested-by: Ramesh Errabolu <[email protected]>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++---------
> 1 file changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> index 083ac9babfa8..30430aefcfc7 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> @@ -1196,6 +1196,7 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
> {
> struct kfd_iolink_properties *link, *cpu_link;
> struct kfd_topology_device *cpu_dev;
> + struct amdgpu_device *adev;
> uint32_t cap;
> uint32_t cpu_flag = CRAT_IOLINK_FLAGS_ENABLED;
> uint32_t flag = CRAT_IOLINK_FLAGS_ENABLED;
> @@ -1203,18 +1204,24 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
> if (!dev || !dev->gpu)
> return;
>
> - 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;
> + 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 (!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;
> + 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) {
> --
> 2.17.1
>
>_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Felix Kuehling
maintainerAm 2021-04-30 um 2:16 p.m. schrieb Zeng, Oak:
Quoted 5 lines
Sorry I should be clearer.
dev->gpu->pci_atomic_requestedis set to the value ofadev->have_atomics_support- see functionamdgpu_amdkfd_have_atomics_support.adev->have_atomics_supportis set through functionpci_enable_atomic_ops_to_rootcurrently inamdgpu_device_init- I don't think this logic is correct for xgmi connected devices. For xgmi connected devices,adev->have_atomics_supportshould always set to true. +@Cornwall, Jay to comment as the original author of this codes.The codes Jon put below refers
dev->gpu->pci_atomic_requestedto set the io link properties. I think we should fixadev->have_atomics_supportwhich is the source ofdev->gpu->pci_atomic_requested. Onceadev->have_atomics_supportis fixed, part of the code inkfd_topology.cdoesn't need to be changed.
I disagree. You're basically just changing the name of a variable. That doesn't change any of the logic.
Quoted 5 lines
Currently
kfd_topology.cis the only consumer ofadev->have_atomics_supportand seems we only use such information for gpu-gpu io-link not for gpu-cpu iolink properties. But I still think we fix it from the source is better because in the future there might be code refers toadev->have_atomics_support. The code I put below is wrong though, it should be:
If (!adev->gmc.xgmi.num_physical_nodes)r = pci_enable_atomic_ops_to_root(adev->pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP32 | PCI_EXP_DEVCAP2_ATOMIC_COMP64);
No. pci_enable_atomic_ops_to_root enables the GPU to perform atomic ops on system memory over PCIe. The number of nodes in an XGMI hive has no influence on this. The only situation where we don't need this is on GPUs that connect to the host via XGMI. So the condition if (!adev->gmc.xgmi.connected_to_cpu) is correct.
Regards,
Felix
Quoted 96 lines
Regards,
OakOn 2021-04-29, 10:45 PM, "Kuehling, Felix" <[email protected]> wrote:
Am 2021-04-29 um 9:12 p.m. schrieb Zeng, Oak: > I think part of this can be done more clean in amdgpu_device_init: > > r = 0; > If (!adev->gmc.xgmi.connected_to_cpu) > /* enable PCIE atomic ops */ > r = pci_enable_atomic_ops_to_root(adev->pdev, > PCI_EXP_DEVCAP2_ATOMIC_COMP32 | > PCI_EXP_DEVCAP2_ATOMIC_COMP64); > if (r) { > adev->have_atomics_support = false; > DRM_INFO("PCIE atomic ops is not supported\n"); > } else { > adev->have_atomics_support = true; > } This code is already in amdgpu_device_init. I'm not sure what's your point. Are you suggesting that the topology flags should be updated in amdgpu_device_init? That's not really possible because the KFD topology data structures don't exist at that time (they do only after the call to amdgpu_device_ip_init) and the data structures are not known in amdgpu_device.c. It's cleaner to keep this compartmentalized in kfd_topology.c. Regards, Felix > Regards, > Oak > > > > On 2021-04-29, 5:36 AM, "Kim, Jonathan" <[email protected]> wrote: > > Link atomics support over xGMI should be reported independently of PCIe. > > Signed-off-by: Jonathan Kim <[email protected]> > Tested-by: Ramesh Errabolu <[email protected]> > --- > drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 29 ++++++++++++++--------- > 1 file changed, 18 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > index 083ac9babfa8..30430aefcfc7 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > @@ -1196,6 +1196,7 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) > { > struct kfd_iolink_properties *link, *cpu_link; > struct kfd_topology_device *cpu_dev; > + struct amdgpu_device *adev; > uint32_t cap; > uint32_t cpu_flag = CRAT_IOLINK_FLAGS_ENABLED; > uint32_t flag = CRAT_IOLINK_FLAGS_ENABLED; > @@ -1203,18 +1204,24 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) > if (!dev || !dev->gpu) > return; > > - 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; > + 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 (!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; > + 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;
Quoted 9 lines
> + }
>
> /* GPU only creates direct links so apply flags setting to all */
> list_for_each_entry(link, &dev->io_link_props, list) {
> --
> 2.17.1
>
>_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
Quoted 42 lines
-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, April 30, 2021 2:55 PM
To: Zeng, Oak <[email protected]>; Kim, Jonathan <[email protected]>; [email protected]; Cornwall, Jay <[email protected]>
Cc: Errabolu, Ramesh <[email protected]>
Subject: Re: [PATCH] drm/amdkfd: report atomics support inio_linksover xgmiAm 2021-04-30 um 2:16 p.m. schrieb Zeng, Oak:
Quoted 4 lines
Sorry I should be clearer.
dev->gpu->pci_atomic_requestedis set to the value of adev-have_atomics_support- see function
amdgpu_amdkfd_have_atomics_support.adev->have_atomics_supportis set through functionpci_enable_atomic_ops_to_rootcurrently inamdgpu_device_init- I don't think this logic is correct for xgmi connected devices. For xgmi connected devices,adev->have_atomics_supportshould always set to true. +@Cornwall, Jay to comment as the original author of this codes.Quoted 2 lines
The codes Jon put below refers
dev->gpu->pci_atomic_requestedto setthe io link properties. I think we should fix
adev->have_atomics_supportwhich is the source ofdev->gpu->pci_atomic_requested. Once adev-Quoted 1 line
have_atomics_supportis fixed, part of the code inkfd_topology.cdoesn'tneed to be changed.
I disagree. You're basically just changing the name of a variable. That doesn't change any of the logic.
Quoted 2 lines
Currently
kfd_topology.cis the only consumer of adev-have_atomics_supportand seems we only use such information for gpu-gpu io-link not for gpu-cpu iolink properties. But I still think we fix it from the source is better because in the future there might be code refers to adev-
Quoted 4 lines
have_atomics_support. The code I put below is wrong though, it should be:
If (!adev->gmc.xgmi.num_physical_nodes)
r = pci_enable_atomic_ops_to_root(adev->pdev,
PCI_EXP_DEVCAP2_ATOMIC_COMP32|Quoted 1 line
Quoted 7 lines
PCI_EXP_DEVCAP2_ATOMIC_COMP64);No.
pci_enable_atomic_ops_to_rootenables the GPU to perform atomic ops on system memory over PCIe. The number of nodes in an XGMI hive has no influence on this. The only situation where we don't need this is on GPUs that connect to the host via XGMI. So the condition if (!adev->gmc.xgmi.connected_to_cpu) is correct.
Then it seems like this was missed in the review and a follow on fix will be needed to be applied (basically remove this condition and move the denial of the pci_atomic_requested check under the kfd topology !connected_to_cpu condition that currently only denies pcie_capability_read_dword checks for cpu POV flags:
Quoted 7 lines
Quoted 7 lines
+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; +}
Thanks,
Jon
Quoted 110 lines
Regards,
FelixQuoted 7 lines
Regards,
OakOn 2021-04-29, 10:45 PM, "Kuehling, Felix" <[email protected]>
Quoted 10 lines · wrote:
Am 2021-04-29 um 9:12 p.m. schrieb Zeng, Oak: > I think part of this can be done more clean in amdgpu_device_init: > > r = 0; > If (!adev->gmc.xgmi.connected_to_cpu) > /* enable PCIE atomic ops */ > r = pci_enable_atomic_ops_to_root(adev->pdev, >
PCI_EXP_DEVCAP2_ATOMIC_COMP32|Quoted 1 line
Quoted 1 line
PCI_EXP_DEVCAP2_ATOMIC_COMP64);Quoted 25 lines
Quoted 6 lines
if (r) {
adev->have_atomics_support= false;DRM_INFO("PCIE atomic ops is not supported\n");
} else {adev->have_atomics_support= true;
}This code is already in
amdgpu_device_init. I'm not sure what's your point. Are you suggesting that the topology flags should be updated inamdgpu_device_init? That's not really possible because the KFD topology data structures don't exist at that time (they do only after the call toamdgpu_device_ip_init) and the data structures are not known inamdgpu_device.c. It's cleaner to keep this compartmentalized inkfd_topology.c.Regards,
Felix> Regards,
> Oak
>
>
>
> On 2021-04-29, 5:36 AM, "Kim, Jonathan" <[email protected]>Quoted 2 lines · wrote:
Quoted 2 lines
Link atomics support over xGMI should be reported independently of
PCIe.
Quoted 5 lines
Quoted 5 lines
Signed-off-by Jonathan Kim <[email protected]>Tested-by Ramesh Errabolu <[email protected]>---
drivers/gpu/drm/amd/amdkfd/kfd_topology.c| 29++++++++++++++---------
Quoted 3 lines
Quoted 3 lines
1 file changed, 18 insertions(+), 11 deletions(-)diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
b/drivers/gpu/drm/amd/amdkfd/kfd_topology.cQuoted 4 lines
Quoted 4 lines
index 083ac9babfa8..30430aefcfc7 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -1196,6 +1196,7 @@ static void
kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)Quoted 8 lines
Quoted 8 lines
{ struct kfd_iolink_properties *link, *cpu_link; struct kfd_topology_device *cpu_dev; +struct amdgpu_device *adev; uint32_t cap; uint32_t cpu_flag = CRAT_IOLINK_FLAGS_ENABLED; uint32_t flag = CRAT_IOLINK_FLAGS_ENABLED; @@ -1203,18 +1204,24 @@ static void
kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)Quoted 9 lines
Quoted 9 lines
if (!dev || !dev->gpu) return; -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|Quoted 9 lines
Quoted 9 lines
-CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT; +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|Quoted 1 line
Quoted 1 line
+
CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT;Quoted 9 lines
Quoted 9 lines
+} -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; +if (!adev->gmc.xgmi.num_physical_nodes) { +if (!dev->gpu->pci_atomic_requested || +dev->gpu->device_info->asic_family
Quoted 15 lines
==
Quoted 2 lines
Quoted 2 lines
+CHIP_HAWAII) +flag |=
CRAT_IOLINK_FLAGS_NO_ATOMICS_32_BIT|Quoted 1 line
Quoted 1 line
+
CRAT_IOLINK_FLAGS_NO_ATOMICS_64_BIT;Quoted 9 lines
Quoted 8 lines
+} /* GPU only creates direct links so apply flags setting to all */ list_for_each_entry(link, &dev->io_link_props, list) { -- 2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx