diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-01-13 08:42:01 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@hobbes.lan> | 2009-03-19 22:29:22 -0400 |
commit | f118c0c3cff4fed39bde1863f9d59850719645cc (patch) | |
tree | aef3aaa33d5c20c21d222e43ce295693d1f0d718 /drivers/pci/pcie/portdrv_pci.c | |
parent | 90e9cd50f7feeddc911325c8a8c1b7e1fccc6599 (diff) |
PCI: PCIe portdrv: Do not enable port device before setting up interrupts
The PCI Express port driver calls pci_enable_device() before setting
up interrupts, which is wrong, because if there is an interrupt pin
configured for the port, pci_enable_device() will likely set up an
interrupt link for it. However, this shouldn't be done if either
MSI or MSI-X interrupt mode is chosen for the port.
The solution is to call pci_enable_device() after setting up
interrupts, because in that case the interrupt link won't be set up
if MSI or MSI-X are enabled.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie/portdrv_pci.c')
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 5ea566e20b37..d17611f390bd 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -82,18 +82,13 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev, | |||
82 | if (status) | 82 | if (status) |
83 | return status; | 83 | return status; |
84 | 84 | ||
85 | if (pci_enable_device(dev) < 0) | ||
86 | return -ENODEV; | ||
87 | |||
88 | pci_set_master(dev); | ||
89 | if (!dev->irq && dev->pin) { | 85 | if (!dev->irq && dev->pin) { |
90 | dev_warn(&dev->dev, "device [%04x:%04x] has invalid IRQ; " | 86 | dev_warn(&dev->dev, "device [%04x:%04x] has invalid IRQ; " |
91 | "check vendor BIOS\n", dev->vendor, dev->device); | 87 | "check vendor BIOS\n", dev->vendor, dev->device); |
92 | } | 88 | } |
93 | if (pcie_port_device_register(dev)) { | 89 | status = pcie_port_device_register(dev); |
94 | pci_disable_device(dev); | 90 | if (status) |
95 | return -ENOMEM; | 91 | return status; |
96 | } | ||
97 | 92 | ||
98 | pcie_portdrv_save_config(dev); | 93 | pcie_portdrv_save_config(dev); |
99 | 94 | ||