Skip to content

Commit

Permalink
Merge branch 'pci/shengzhou-irq' into next
Browse files Browse the repository at this point in the history
* pci/shengzhou-irq:
  PCI: Use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
  • Loading branch information
Bjorn Helgaas committed Sep 10, 2012
2 parents 5aaa71c + e237d83 commit a690a4c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/pci/pcie/portdrv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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:
Expand Down

0 comments on commit a690a4c

Please sign in to comment.