Skip to contentSkip to conversation

drm/amdgpu: improve MSI-X handling

PATCH In review Alex Deucher 3 participants 4 messages Oct 3, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: improve MSI-X handling

Check the number of supported vectors and fall back to MSI if we return or error or 0 MSI-X vectors.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +11 -3
index 50771b2757dc..98aa28edba6a 100644
@@ -245,11 +245,19 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
 	adev->irq.msi_enabled = false;
 
 	if (amdgpu_msi_ok(adev)) {
-		int nvec = pci_alloc_irq_vectors(adev->pdev, 1, pci_msix_vec_count(adev->pdev),
-					PCI_IRQ_MSI | PCI_IRQ_MSIX);
+		unsigned int flags;
+		int nvec = pci_msix_vec_count(adev->pdev);
+
+		if (nvec <= 0) {
+			flags = PCI_IRQ_MSI;
+			nvec = 1;
+		} else {
+			flags = PCI_IRQ_MSI | PCI_IRQ_MSIX;
+		}
+		nvec = pci_alloc_irq_vectors(adev->pdev, 1, nvec, flags);
 		if (nvec > 0) {
 			adev->irq.msi_enabled = true;
-			dev_dbg(adev->dev, "amdgpu: using MSI.\n");
+			dev_dbg(adev->dev, "amdgpu: using MSI/MSI-X.\n");
 		}
 	}
 
Signature · 6 lines
2.20.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): 20191003141326.7600-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amdgpu: disable MSI-X on APUs

Raven claims to support them, but seems to have problems. Stick with MSIs for now on APUs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +2 -1
index 98aa28edba6a..8f2236bd7d0e 100644
@@ -248,7 +248,8 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
 		unsigned int flags;
 		int nvec = pci_msix_vec_count(adev->pdev);
 
-		if (nvec <= 0) {
+		/* Raven claims to support MSI-X, but seems to have problems */
+		if ((nvec <= 0) || (adev->flags & AMD_IS_APU)) {
 			flags = PCI_IRQ_MSI;
 			nvec = 1;
 		} else {
Signature · 6 lines
2.20.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): 20191003141326.7600-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#4 lore raw

Re: [PATCH 2/2] drm/amdgpu: disable MSI-X on APUs

Thanks Alex and  Tom to catch and  revolve the issue .  I didn't do enough test on original test.

We don't need to enable msix  on APU .   The serials is reviewed by shaoyun.liu <[email protected]>

Regards

shaoyun.liu

Quoted 14 lines · Alex Deucher

Raven claims to support them, but seems to have problems. Stick with MSIs for now on APUs.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +0 -0
index 98aa28edba6a..8f2236bd7d0e 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c int amdgpu_irq_init(struct amdgpu_device *adev) · line 255

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +2 -1
@@ -248,7 +248,8 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
  		unsigned int flags;
  		int nvec = pci_msix_vec_count(adev->pdev);
 
-		if (nvec <= 0) {
+		/* Raven claims to support MSI-X, but seems to have problems */
+		if ((nvec <= 0) || (adev->flags & AMD_IS_APU)) {
  			flags = PCI_IRQ_MSI;
  			nvec = 1;
  		} else {

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

#5 lore raw
In reply to a message not in the archive

Series are Reviewed-by: Huang Rui <[email protected]>

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 3, 2019 10:13 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: improve MSI-X handling

Check the number of supported vectors and fall back to MSI if we return or error or 0 MSI-X vectors.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +11 -3
index 50771b2757dc..98aa28edba6a 100644
@@ -245,11 +245,19 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
 	adev->irq.msi_enabled = false;
 
 	if (amdgpu_msi_ok(adev)) {
-		int nvec = pci_alloc_irq_vectors(adev->pdev, 1, pci_msix_vec_count(adev->pdev),
-					PCI_IRQ_MSI | PCI_IRQ_MSIX);
+		unsigned int flags;
+		int nvec = pci_msix_vec_count(adev->pdev);
+
+		if (nvec <= 0) {
+			flags = PCI_IRQ_MSI;
+			nvec = 1;
+		} else {
+			flags = PCI_IRQ_MSI | PCI_IRQ_MSIX;
+		}
+		nvec = pci_alloc_irq_vectors(adev->pdev, 1, nvec, flags);
 		if (nvec > 0) {
 			adev->irq.msi_enabled = true;
-			dev_dbg(adev->dev, "amdgpu: using MSI.\n");
+			dev_dbg(adev->dev, "amdgpu: using MSI/MSI-X.\n");
 		}
 	}
 

--
2.20.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