|
@@ -1107,14 +1107,11 @@ static int pci_cfg_space_size_ext(struct pci_dev *dev)
|
|
int pos = PCI_CFG_SPACE_SIZE;
|
|
int pos = PCI_CFG_SPACE_SIZE;
|
|
|
|
|
|
if (pci_read_config_dword(dev, pos, &status) != PCIBIOS_SUCCESSFUL)
|
|
if (pci_read_config_dword(dev, pos, &status) != PCIBIOS_SUCCESSFUL)
|
|
- goto fail;
|
|
|
|
|
|
+ return PCI_CFG_SPACE_SIZE;
|
|
if (status == 0xffffffff || pci_ext_cfg_is_aliased(dev))
|
|
if (status == 0xffffffff || pci_ext_cfg_is_aliased(dev))
|
|
- goto fail;
|
|
|
|
|
|
+ return PCI_CFG_SPACE_SIZE;
|
|
|
|
|
|
return PCI_CFG_SPACE_EXP_SIZE;
|
|
return PCI_CFG_SPACE_EXP_SIZE;
|
|
-
|
|
|
|
- fail:
|
|
|
|
- return PCI_CFG_SPACE_SIZE;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
int pci_cfg_space_size(struct pci_dev *dev)
|
|
int pci_cfg_space_size(struct pci_dev *dev)
|
|
@@ -1127,25 +1124,23 @@ int pci_cfg_space_size(struct pci_dev *dev)
|
|
if (class == PCI_CLASS_BRIDGE_HOST)
|
|
if (class == PCI_CLASS_BRIDGE_HOST)
|
|
return pci_cfg_space_size_ext(dev);
|
|
return pci_cfg_space_size_ext(dev);
|
|
|
|
|
|
- if (!pci_is_pcie(dev)) {
|
|
|
|
- pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
|
|
|
|
- if (!pos)
|
|
|
|
- goto fail;
|
|
|
|
|
|
+ if (pci_is_pcie(dev))
|
|
|
|
+ return pci_cfg_space_size_ext(dev);
|
|
|
|
|
|
- pci_read_config_dword(dev, pos + PCI_X_STATUS, &status);
|
|
|
|
- if (!(status & (PCI_X_STATUS_266MHZ | PCI_X_STATUS_533MHZ)))
|
|
|
|
- goto fail;
|
|
|
|
- }
|
|
|
|
|
|
+ pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
|
|
|
|
+ if (!pos)
|
|
|
|
+ return PCI_CFG_SPACE_SIZE;
|
|
|
|
|
|
- return pci_cfg_space_size_ext(dev);
|
|
|
|
|
|
+ pci_read_config_dword(dev, pos + PCI_X_STATUS, &status);
|
|
|
|
+ if (status & (PCI_X_STATUS_266MHZ | PCI_X_STATUS_533MHZ))
|
|
|
|
+ return pci_cfg_space_size_ext(dev);
|
|
|
|
|
|
- fail:
|
|
|
|
return PCI_CFG_SPACE_SIZE;
|
|
return PCI_CFG_SPACE_SIZE;
|
|
}
|
|
}
|
|
|
|
|
|
#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 +1207,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 */
|
|
@@ -1603,8 +1596,8 @@ static void pci_init_capabilities(struct pci_dev *dev)
|
|
/* Enhanced Allocation */
|
|
/* Enhanced Allocation */
|
|
pci_ea_init(dev);
|
|
pci_ea_init(dev);
|
|
|
|
|
|
- /* MSI/MSI-X list */
|
|
|
|
- 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);
|