]> Pileus Git - ~andy/linux/commitdiff
PCI: Use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
authorShengzhou Liu <Shengzhou.Liu@freescale.com>
Wed, 18 Jul 2012 06:06:54 +0000 (14:06 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 7 Sep 2012 21:40:31 +0000 (15:40 -0600)
On some platforms, root port has neither MSI/MSI-X nor INTx interrupt
generated in RC mode. In this case, we have to use other interrupt, e.g.,
system shared interrupt, for port service IRQ to have AER, Hot-plug, etc.,
services work.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/portdrv_core.c

index 75915b30ad19db7438a935edbfad846127061843..eaa39fb448c471195bc61b2ac3c7b4fcad5a647d 100644 (file)
@@ -200,10 +200,13 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
 {
        int i, irq = -1;
 
-       /* We have to use INTx if MSI cannot be used for PCIe PME or pciehp. */
+       /*
+        * If MSI cannot be used for PCIe PME or hotplug, we have to use
+        * INTx or other interrupts, e.g. system shared interrupt.
+        */
        if (((mask & PCIE_PORT_SERVICE_PME) && pcie_pme_no_msi()) ||
            ((mask & PCIE_PORT_SERVICE_HP) && pciehp_no_msi())) {
-               if (dev->pin)
+               if (dev->irq)
                        irq = dev->irq;
                goto no_msi;
        }
@@ -212,8 +215,12 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
        if (!pcie_port_enable_msix(dev, irqs, mask))
                return 0;
 
-       /* We're not going to use MSI-X, so try MSI and fall back to INTx */
-       if (!pci_enable_msi(dev) || dev->pin)
+       /*
+        * We're not going to use MSI-X, so try MSI and fall back to INTx.
+        * If neither MSI/MSI-X nor INTx available, try other interrupt.  On
+        * some platforms, root port doesn't support MSI/MSI-X/INTx in RC mode.
+        */
+       if (!pci_enable_msi(dev) || dev->irq)
                irq = dev->irq;
 
  no_msi: