Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1279755

[PATCH] PCI: MSI: Only use the generic MSI layer when domain is hierarchical

From Phil Edworthy <phil.edworthy@renesas.com>
Newsgroups linux.kernel
Subject [PATCH] PCI: MSI: Only use the generic MSI layer when domain is hierarchical
Date 2015-11-30 11:30 +0100
Message-ID <qAtSy-2jv-13@gated-at.bofh.it> (permalink)
References <qy0hY-2Wb-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Cc'd linux-pci ml

On 23 November 2015 14:27, Marc Zyngier wrote:

Since d8a1cb757550 ("PCI/MSI: Let pci_msi_get_domain use struct
device::msi_domain"), we use the MSI domain associated to the PCI device.

But finding a MSI domain doesn't mean that the domain is implemented
using the generic MSI domain API, and a number of MSI controllers
are still using the arch_setup_msi_irq/arch_teardown_msi_irqs.

In order to avoid a firework on these systems, check that the domain
we just obtained is hierarchical. If not, don't use the generic MSI
stuff and stick with the old one. Not pretty, but reliable.

Another insentive to rework those drivers and phase out this API.

Reported-by: Phil Edworthy <phil.edworthy@renesas.com>
Tested-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/pci/msi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 53e4632..7eaa4c8 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -54,7 +54,7 @@ static int pci_msi_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 	struct irq_domain *domain;
 
 	domain = pci_msi_get_domain(dev);
-	if (domain)
+	if (domain && irq_domain_is_hierarchy(domain))
 		return pci_msi_domain_alloc_irqs(domain, dev, nvec, type);
 
 	return arch_setup_msi_irqs(dev, nvec, type);
@@ -65,7 +65,7 @@ static void pci_msi_teardown_msi_irqs(struct pci_dev *dev)
 	struct irq_domain *domain;
 
 	domain = pci_msi_get_domain(dev);
-	if (domain)
+	if (domain && irq_domain_is_hierarchy(domain))
 		pci_msi_domain_free_irqs(domain, dev);
 	else
 		arch_teardown_msi_irqs(dev);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] PCI: MSI: Only use the generic MSI layer when domain is hierarchical Marc Zyngier <marc.zyngier@arm.com> - 2015-11-23 15:30 +0100
  Re: [PATCH] PCI: MSI: Only use the generic MSI layer when domain is  hierarchical Thomas Gleixner <tglx@linutronix.de> - 2015-11-23 18:40 +0100
    Re: [PATCH] PCI: MSI: Only use the generic MSI layer when domain  is hierarchical Marc Zyngier <marc.zyngier@arm.com> - 2015-12-03 17:50 +0100
  [PATCH] PCI: MSI: Only use the generic MSI layer when domain is  hierarchical Phil Edworthy <phil.edworthy@renesas.com> - 2015-11-30 11:30 +0100
    Re: [PATCH] PCI: MSI: Only use the generic MSI layer when domain is  hierarchical Bjorn Helgaas <helgaas@kernel.org> - 2015-12-04 01:30 +0100
      Re: [PATCH] PCI: MSI: Only use the generic MSI layer when domain is  hierarchical Marc Zyngier <marc.zyngier@arm.com> - 2015-12-04 09:10 +0100
        Re: [PATCH] PCI: MSI: Only use the generic MSI layer when domain is  hierarchical Bjorn Helgaas <helgaas@kernel.org> - 2015-12-04 17:20 +0100
          Re: [PATCH] PCI: MSI: Only use the generic MSI layer when domain  is hierarchical Marc Zyngier <marc.zyngier@arm.com> - 2015-12-04 18:10 +0100
            Re: [PATCH] PCI: MSI: Only use the generic MSI layer when domain is  hierarchical Bjorn Helgaas <helgaas@kernel.org> - 2015-12-04 18:50 +0100

csiph-web