diff options
author | Shengzhou Liu <Shengzhou.Liu@freescale.com> | 2012-07-18 02:06:54 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-09-07 17:40:31 -0400 |
commit | e237d83fdf0313d26af46f41b69b3b87d62669c0 (patch) | |
tree | e7ba6db54a2d3f65d5330722dc1f30c343acd3c8 /drivers/pci | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
PCI: Use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pcie/portdrv_core.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 75915b30ad19..eaa39fb448c4 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -200,10 +200,13 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask) | |||
200 | { | 200 | { |
201 | int i, irq = -1; | 201 | int i, irq = -1; |
202 | 202 | ||
203 | /* We have to use INTx if MSI cannot be used for PCIe PME or pciehp. */ | 203 | /* |
204 | * If MSI cannot be used for PCIe PME or hotplug, we have to use | ||
205 | * INTx or other interrupts, e.g. system shared interrupt. | ||
206 | */ | ||
204 | if (((mask & PCIE_PORT_SERVICE_PME) && pcie_pme_no_msi()) || | 207 | if (((mask & PCIE_PORT_SERVICE_PME) && pcie_pme_no_msi()) || |
205 | ((mask & PCIE_PORT_SERVICE_HP) && pciehp_no_msi())) { | 208 | ((mask & PCIE_PORT_SERVICE_HP) && pciehp_no_msi())) { |
206 | if (dev->pin) | 209 | if (dev->irq) |
207 | irq = dev->irq; | 210 | irq = dev->irq; |
208 | goto no_msi; | 211 | goto no_msi; |
209 | } | 212 | } |
@@ -212,8 +215,12 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask) | |||
212 | if (!pcie_port_enable_msix(dev, irqs, mask)) | 215 | if (!pcie_port_enable_msix(dev, irqs, mask)) |
213 | return 0; | 216 | return 0; |
214 | 217 | ||
215 | /* We're not going to use MSI-X, so try MSI and fall back to INTx */ | 218 | /* |
216 | if (!pci_enable_msi(dev) || dev->pin) | 219 | * We're not going to use MSI-X, so try MSI and fall back to INTx. |
220 | * If neither MSI/MSI-X nor INTx available, try other interrupt. On | ||
221 | * some platforms, root port doesn't support MSI/MSI-X/INTx in RC mode. | ||
222 | */ | ||
223 | if (!pci_enable_msi(dev) || dev->irq) | ||
217 | irq = dev->irq; | 224 | irq = dev->irq; |
218 | 225 | ||
219 | no_msi: | 226 | no_msi: |