diff options
author | Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com> | 2015-10-21 10:17:35 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-11-24 18:45:18 -0500 |
commit | e80e7edc55ba711f3fe23975061b3f1c336ceb95 (patch) | |
tree | 3719ac21b2b463301894b30dfcbb0719c4e489f6 /drivers/pci/probe.c | |
parent | 1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff) |
PCI/MSI: Initialize MSI capability for all architectures
1851617cd2da ("PCI/MSI: Disable MSI at enumeration even if kernel doesn't
support MSI") moved dev->msi_cap and dev->msix_cap initialization from the
pci_init_capabilities() path (used on all architectures) to the
pci_setup_device() path (not used on Open Firmware architectures).
This broke MSI or MSI-X on Open Firmware machines. 4d9aac397a5d
("powerpc/PCI: Disable MSI/MSI-X interrupts at PCI probe time in OF case")
fixed it for PowerPC but not for SPARC.
Set up MSI and MSI-X (initialize msi_cap and msix_cap and disable MSI and
MSI-X) in pci_init_capabilities() so all architectures do it the same way.
This reverts 4d9aac397a5d since this patch fixes the problem generically
for both PowerPC and SPARC.
[bhelgaas: changelog, make pci_msi_setup_pci_dev() static]
Fixes: 1851617cd2da ("PCI/MSI: Disable MSI at enumeration even if kernel doesn't support MSI")
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index edb1984201e9..cd94737af8fd 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -1145,7 +1145,7 @@ int pci_cfg_space_size(struct pci_dev *dev) | |||
1145 | 1145 | ||
1146 | #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) | 1146 | #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) |
1147 | 1147 | ||
1148 | void pci_msi_setup_pci_dev(struct pci_dev *dev) | 1148 | static void pci_msi_setup_pci_dev(struct pci_dev *dev) |
1149 | { | 1149 | { |
1150 | /* | 1150 | /* |
1151 | * Disable the MSI hardware to avoid screaming interrupts | 1151 | * Disable the MSI hardware to avoid screaming interrupts |
@@ -1212,8 +1212,6 @@ int pci_setup_device(struct pci_dev *dev) | |||
1212 | /* "Unknown power state" */ | 1212 | /* "Unknown power state" */ |
1213 | dev->current_state = PCI_UNKNOWN; | 1213 | dev->current_state = PCI_UNKNOWN; |
1214 | 1214 | ||
1215 | pci_msi_setup_pci_dev(dev); | ||
1216 | |||
1217 | /* Early fixups, before probing the BARs */ | 1215 | /* Early fixups, before probing the BARs */ |
1218 | pci_fixup_device(pci_fixup_early, dev); | 1216 | pci_fixup_device(pci_fixup_early, dev); |
1219 | /* device class may be changed after fixup */ | 1217 | /* device class may be changed after fixup */ |
@@ -1606,6 +1604,9 @@ static void pci_init_capabilities(struct pci_dev *dev) | |||
1606 | /* MSI/MSI-X list */ | 1604 | /* MSI/MSI-X list */ |
1607 | pci_msi_init_pci_dev(dev); | 1605 | pci_msi_init_pci_dev(dev); |
1608 | 1606 | ||
1607 | /* Setup MSI caps & disable MSI/MSI-X interrupts */ | ||
1608 | pci_msi_setup_pci_dev(dev); | ||
1609 | |||
1609 | /* Buffers for saving PCIe and PCI-X capabilities */ | 1610 | /* Buffers for saving PCIe and PCI-X capabilities */ |
1610 | pci_allocate_cap_save_buffers(dev); | 1611 | pci_allocate_cap_save_buffers(dev); |
1611 | 1612 | ||