Commit e80e7edc authored by Guilherme G. Piccoli's avatar Guilherme G. Piccoli Committed by Bjorn Helgaas

PCI/MSI: Initialize MSI capability for all architectures

1851617c ("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.  4d9aac39
("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 4d9aac39 since this patch fixes the problem generically
for both PowerPC and SPARC.

[bhelgaas: changelog, make pci_msi_setup_pci_dev() static]
Fixes: 1851617c ("PCI/MSI: Disable MSI at enumeration even if kernel doesn't support MSI")
Signed-off-by: default avatarGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 1ec21837
...@@ -187,9 +187,6 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, ...@@ -187,9 +187,6 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
pci_device_add(dev, bus); pci_device_add(dev, bus);
/* Setup MSI caps & disable MSI/MSI-X interrupts */
pci_msi_setup_pci_dev(dev);
return dev; return dev;
} }
EXPORT_SYMBOL(of_create_pci_dev); EXPORT_SYMBOL(of_create_pci_dev);
......
...@@ -1145,7 +1145,7 @@ int pci_cfg_space_size(struct pci_dev *dev) ...@@ -1145,7 +1145,7 @@ int pci_cfg_space_size(struct pci_dev *dev)
#define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED)
void pci_msi_setup_pci_dev(struct pci_dev *dev) static void pci_msi_setup_pci_dev(struct pci_dev *dev)
{ {
/* /*
* Disable the MSI hardware to avoid screaming interrupts * Disable the MSI hardware to avoid screaming interrupts
...@@ -1212,8 +1212,6 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1212,8 +1212,6 @@ int pci_setup_device(struct pci_dev *dev)
/* "Unknown power state" */ /* "Unknown power state" */
dev->current_state = PCI_UNKNOWN; dev->current_state = PCI_UNKNOWN;
pci_msi_setup_pci_dev(dev);
/* Early fixups, before probing the BARs */ /* Early fixups, before probing the BARs */
pci_fixup_device(pci_fixup_early, dev); pci_fixup_device(pci_fixup_early, dev);
/* device class may be changed after fixup */ /* device class may be changed after fixup */
...@@ -1606,6 +1604,9 @@ static void pci_init_capabilities(struct pci_dev *dev) ...@@ -1606,6 +1604,9 @@ static void pci_init_capabilities(struct pci_dev *dev)
/* MSI/MSI-X list */ /* MSI/MSI-X list */
pci_msi_init_pci_dev(dev); pci_msi_init_pci_dev(dev);
/* Setup MSI caps & disable MSI/MSI-X interrupts */
pci_msi_setup_pci_dev(dev);
/* Buffers for saving PCIe and PCI-X capabilities */ /* Buffers for saving PCIe and PCI-X capabilities */
pci_allocate_cap_save_buffers(dev); pci_allocate_cap_save_buffers(dev);
......
...@@ -1248,8 +1248,6 @@ struct msix_entry { ...@@ -1248,8 +1248,6 @@ struct msix_entry {
u16 entry; /* driver uses to specify entry, OS writes */ u16 entry; /* driver uses to specify entry, OS writes */
}; };
void pci_msi_setup_pci_dev(struct pci_dev *dev);
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
int pci_msi_vec_count(struct pci_dev *dev); int pci_msi_vec_count(struct pci_dev *dev);
void pci_msi_shutdown(struct pci_dev *dev); void pci_msi_shutdown(struct pci_dev *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment