Skip to contentSkip to conversation

drm/amdgpu: enable PCIE atomics ops support

PATCH In review Xiao, Jack 4 participants 5 messages May 27, 2019 – May 28, 2019 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Xiao, Jack

author
#0 lore raw

PATCH 1/1 drm/amdgpu: enable PCIE atomics ops support

GPU atomics operation depends on PCIE atomics support. Always enable PCIE atomics ops support in case that it hasn't been enabled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
index bdd1fe73..a2c6064 100644
@@ -2562,6 +2562,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	if (adev->rio_mem == NULL)
 		DRM_INFO("PCI I/O BAR is not found.\n");
 
+	/* 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)
+		DRM_INFO("PCIE atomic ops is not supported\n");
+
 	amdgpu_device_get_pcie_info(adev);
 
 	/* early init functions */
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1558952326-5611-1-git-send-email-Jack.Xiao-5C7GfCeVMHo@public.gmane.org

#2 lore raw

How about put pci_enable_atomic_ops_to_root ahead of amdgpu_device_ip_early_init, while move pci_atomic_requested from kfd device to kgd device ? In such way, we can avoid duplicate atomic request from both amdgpu and amdkfd.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Xiao, Jack
Sent: 2019年5月27日 18:19
To: [email protected]
Cc: Xiao, Jack <[email protected]>
Subject: [PATCH] drm/amdgpu: enable PCIE atomics ops support

GPU atomics operation depends on PCIE atomics support.
Always enable PCIE atomics ops support in case that it hasn't been enabled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
index bdd1fe73..a2c6064 100644
@@ -2562,6 +2562,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	if (adev->rio_mem == NULL)
 		DRM_INFO("PCI I/O BAR is not found.\n");
 
+	/* 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)
+		DRM_INFO("PCIE atomic ops is not supported\n");
+
 	amdgpu_device_get_pcie_info(adev);
 
 	/* early init functions */

--
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BYAPR12MB26323A2A4408EB2EBB1A1448FC1D0-ZGDeBxoHBPk+ukJnzp2+RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw

That idea sounds sane to me as well.

By the way, do we somewhere signal to userspace if atomics are supported or not?

I mean would be nice to keep the state inside adev if this fails for some reason.

Christian.

Am 27.05.19 um 13:16 schrieb Zhang, Hawking:

Quoted 40 lines

How about put pci_enable_atomic_ops_to_root ahead of amdgpu_device_ip_early_init, while move pci_atomic_requested from kfd device to kgd device ? In such way, we can avoid duplicate atomic request from both amdgpu and amdkfd.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Xiao, Jack
Sent: 2019年5月27日 18:19
To: [email protected]
Cc: Xiao, Jack <[email protected]>
Subject: [PATCH] drm/amdgpu: enable PCIE atomics ops support

GPU atomics operation depends on PCIE atomics support.
Always enable PCIE atomics ops support in case that it hasn't been enabled.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -1
index bdd1fe73..a2c6064 100644
@@ -2562,6 +2562,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
  	if (adev->rio_mem == NULL)
  		DRM_INFO("PCI I/O BAR is not found.\n");
 
+	/* 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)
+		DRM_INFO("PCIE atomic ops is not supported\n");
+
  	amdgpu_device_get_pcie_info(adev);
 
  	/* early init functions */
--

1.9.1

Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): dc7f3fa5-2b67-0b05-e3f0-46f3733a430a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#6 lore raw
Quoted 4 lines · Christian König

That idea sounds sane to me as well.

By the way, do we somewhere signal to userspace if atomics are supported or not?

Yes. KFD topology (a flag in the iolink) provides that information to user mode.

Regards,
  Felix

Quoted 52 lines

I mean would be nice to keep the state inside adev if this fails for some reason.

Christian.

Am 27.05.19 um 13:16 schrieb Zhang, Hawking:

Quoted 45 lines

How about put pci_enable_atomic_ops_to_root ahead of amdgpu_device_ip_early_init, while move pci_atomic_requested from kfd device to kgd device ? In such way, we can avoid duplicate atomic request from both amdgpu and amdkfd.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Xiao, Jack
Sent: 2019年5月27日 18:19
To: [email protected]
Cc: Xiao, Jack <[email protected]>
Subject: [PATCH] drm/amdgpu: enable PCIE atomics ops support

GPU atomics operation depends on PCIE atomics support. Always enable PCIE atomics ops support in case that it hasn't been enabled.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++

  1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index bdd1fe73..a2c6064 100644
@@ -2562,6 +2562,13 @@ int amdgpu_device_init(struct amdgpu_device 
 *adev,
       if (adev->rio_mem == NULL)
           DRM_INFO("PCI I/O BAR is not found.\n");

  +    /* 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)
+        DRM_INFO("PCIE atomic ops is not supported\n"); +
      amdgpu_device_get_pcie_info(adev);
        /* early init functions */

Signature · 1 line
1.9.1
Quoted 13 lines
Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): f6b13954-1876-6b5a-bebf-4febeb51f155-5C7GfCeVMHo@public.gmane.org

#8 lore raw

Am 27.05.19 um 20:23 schrieb Kuehling, Felix:

Quoted 7 lines · Christian König
Quoted 4 lines

That idea sounds sane to me as well.

By the way, do we somewhere signal to userspace if atomics are supported or not?

Yes. KFD topology (a flag in the iolink) provides that information to user mode.

Yeah, but we are enabling this for the render node as well.

Question is now if we have that in the info IOCTL or not? I strongly suspect that's not present there.

Regards,
Christian.

Quoted 68 lines

Regards,
  Felix

Quoted 51 lines

I mean would be nice to keep the state inside adev if this fails for some reason.

Christian.

Am 27.05.19 um 13:16 schrieb Zhang, Hawking:

Quoted 45 lines

How about put pci_enable_atomic_ops_to_root ahead of amdgpu_device_ip_early_init, while move pci_atomic_requested from kfd device to kgd device ? In such way, we can avoid duplicate atomic request from both amdgpu and amdkfd.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Xiao, Jack
Sent: 2019年5月27日 18:19
To: [email protected]
Cc: Xiao, Jack <[email protected]>
Subject: [PATCH] drm/amdgpu: enable PCIE atomics ops support

GPU atomics operation depends on PCIE atomics support. Always enable PCIE atomics ops support in case that it hasn't been enabled.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
   1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index bdd1fe73..a2c6064 100644
@@ -2562,6 +2562,13 @@ int amdgpu_device_init(struct amdgpu_device
 *adev,
       if (adev->rio_mem == NULL)
           DRM_INFO("PCI I/O BAR is not found.\n");
   +    /* 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)
+        DRM_INFO("PCIE atomic ops is not supported\n");
+
       amdgpu_device_get_pcie_info(adev);
         /* early init functions */
Signature · 1 line
1.9.1
Quoted 12 lines
Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx