* [PATCH 1/2] drm/amdgpu: improve MSI-X handling
@ 2019-10-03 14:13 Alex Deucher
[not found] ` <20191003141326.7600-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2019-10-03 14:13 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher
Check the number of supported vectors and fall back to MSI if
we return or error or 0 MSI-X vectors.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 50771b2757dc..98aa28edba6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] drm/amdgpu: disable MSI-X on APUs
[not found] ` <20191003141326.7600-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2019-10-03 14:13 ` Alex Deucher
[not found] ` <20191003141326.7600-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-10-03 15:07 ` [PATCH 1/2] drm/amdgpu: improve MSI-X handling Huang, Ray
1 sibling, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2019-10-03 14:13 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher, Tom St Denis
Raven claims to support them, but seems to have problems. Stick
with MSIs for now on APUs.
Tested-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 98aa28edba6a..8f2236bd7d0e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -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 {
--
2.20.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] drm/amdgpu: disable MSI-X on APUs
[not found] ` <20191003141326.7600-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2019-10-03 14:27 ` Liu, Shaoyun
0 siblings, 0 replies; 4+ messages in thread
From: Liu, Shaoyun @ 2019-10-03 14:27 UTC (permalink / raw)
To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Deucher, Alexander, StDenis, Tom
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 <shaoyun.liu@amd.com>
Regards
shaoyun.liu
On 2019-10-03 10:13 a.m., Alex Deucher wrote:
> Raven claims to support them, but seems to have problems. Stick
> with MSIs for now on APUs.
>
> Tested-by: Tom St Denis <tom.stdenis@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> index 98aa28edba6a..8f2236bd7d0e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> @@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 1/2] drm/amdgpu: improve MSI-X handling
[not found] ` <20191003141326.7600-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-10-03 14:13 ` [PATCH 2/2] drm/amdgpu: disable MSI-X on APUs Alex Deucher
@ 2019-10-03 15:07 ` Huang, Ray
1 sibling, 0 replies; 4+ messages in thread
From: Huang, Ray @ 2019-10-03 15:07 UTC (permalink / raw)
To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander
Series are Reviewed-by: Huang Rui <ray.huang@amd.com>
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Thursday, October 3, 2019 10:13 AM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
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.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 50771b2757dc..98aa28edba6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-03 15:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-03 14:13 [PATCH 1/2] drm/amdgpu: improve MSI-X handling Alex Deucher
[not found] ` <20191003141326.7600-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-10-03 14:13 ` [PATCH 2/2] drm/amdgpu: disable MSI-X on APUs Alex Deucher
[not found] ` <20191003141326.7600-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-10-03 14:27 ` Liu, Shaoyun
2019-10-03 15:07 ` [PATCH 1/2] drm/amdgpu: improve MSI-X handling Huang, Ray
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.