aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kernel-parameters.txt21
-rw-r--r--drivers/pci/access.c4
-rw-r--r--drivers/pci/hotplug/pciehp_core.c2
-rw-r--r--drivers/pci/pci.c17
-rw-r--r--drivers/pci/pcie/portdrv_core.c2
-rw-r--r--include/linux/pci.h11
6 files changed, 37 insertions, 20 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 363e348bff9b..dd80599559a5 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2227,6 +2227,21 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2227 This sorting is done to get a device 2227 This sorting is done to get a device
2228 order compatible with older (<= 2.4) kernels. 2228 order compatible with older (<= 2.4) kernels.
2229 nobfsort Don't sort PCI devices into breadth-first order. 2229 nobfsort Don't sort PCI devices into breadth-first order.
2230 pcie_bus_tune_off Disable PCIe MPS (Max Payload Size)
2231 tuning and use the BIOS-configured MPS defaults.
2232 pcie_bus_safe Set every device's MPS to the largest value
2233 supported by all devices below the root complex.
2234 pcie_bus_perf Set device MPS to the largest allowable MPS
2235 based on its parent bus. Also set MRRS (Max
2236 Read Request Size) to the largest supported
2237 value (no larger than the MPS that the device
2238 or bus can support) for best performance.
2239 pcie_bus_peer2peer Set every device's MPS to 128B, which
2240 every device is guaranteed to support. This
2241 configuration allows peer-to-peer DMA between
2242 any pair of devices, possibly at the cost of
2243 reduced performance. This also guarantees
2244 that hot-added devices will work.
2230 cbiosize=nn[KMG] The fixed amount of bus space which is 2245 cbiosize=nn[KMG] The fixed amount of bus space which is
2231 reserved for the CardBus bridge's IO window. 2246 reserved for the CardBus bridge's IO window.
2232 The default value is 256 bytes. 2247 The default value is 256 bytes.
@@ -2248,6 +2263,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2248 the default. 2263 the default.
2249 off: Turn ECRC off 2264 off: Turn ECRC off
2250 on: Turn ECRC on. 2265 on: Turn ECRC on.
2266 hpiosize=nn[KMG] The fixed amount of bus space which is
2267 reserved for hotplug bridge's IO window.
2268 Default size is 256 bytes.
2269 hpmemsize=nn[KMG] The fixed amount of bus space which is
2270 reserved for hotplug bridge's memory window.
2271 Default size is 2 megabytes.
2251 realloc= Enable/disable reallocating PCI bridge resources 2272 realloc= Enable/disable reallocating PCI bridge resources
2252 if allocations done by BIOS are too small to 2273 if allocations done by BIOS are too small to
2253 accommodate resources required by all child 2274 accommodate resources required by all child
diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index 3af0478c057b..5278ac692cbf 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -472,7 +472,7 @@ EXPORT_SYMBOL_GPL(pci_cfg_access_unlock);
472 472
473static inline int pcie_cap_version(const struct pci_dev *dev) 473static inline int pcie_cap_version(const struct pci_dev *dev)
474{ 474{
475 return dev->pcie_flags_reg & PCI_EXP_FLAGS_VERS; 475 return pcie_caps_reg(dev) & PCI_EXP_FLAGS_VERS;
476} 476}
477 477
478static inline bool pcie_cap_has_devctl(const struct pci_dev *dev) 478static inline bool pcie_cap_has_devctl(const struct pci_dev *dev)
@@ -497,7 +497,7 @@ static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
497 return pcie_cap_version(dev) > 1 || 497 return pcie_cap_version(dev) > 1 ||
498 type == PCI_EXP_TYPE_ROOT_PORT || 498 type == PCI_EXP_TYPE_ROOT_PORT ||
499 (type == PCI_EXP_TYPE_DOWNSTREAM && 499 (type == PCI_EXP_TYPE_DOWNSTREAM &&
500 dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT); 500 pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT);
501} 501}
502 502
503static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev) 503static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev)
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index 916bf4f53aba..874a3baf1db0 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -294,7 +294,6 @@ static void pciehp_remove(struct pcie_device *dev)
294#ifdef CONFIG_PM 294#ifdef CONFIG_PM
295static int pciehp_suspend (struct pcie_device *dev) 295static int pciehp_suspend (struct pcie_device *dev)
296{ 296{
297 dev_info(&dev->device, "%s ENTRY\n", __func__);
298 return 0; 297 return 0;
299} 298}
300 299
@@ -304,7 +303,6 @@ static int pciehp_resume (struct pcie_device *dev)
304 struct slot *slot; 303 struct slot *slot;
305 u8 status; 304 u8 status;
306 305
307 dev_info(&dev->device, "%s ENTRY\n", __func__);
308 ctrl = get_service_data(dev); 306 ctrl = get_service_data(dev);
309 307
310 /* reinitialize the chipset's event detection logic */ 308 /* reinitialize the chipset's event detection logic */
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 177a50ff6454..393cf095a0c4 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3748,18 +3748,6 @@ resource_size_t pci_specified_resource_alignment(struct pci_dev *dev)
3748 return align; 3748 return align;
3749} 3749}
3750 3750
3751/**
3752 * pci_is_reassigndev - check if specified PCI is target device to reassign
3753 * @dev: the PCI device to check
3754 *
3755 * RETURNS: non-zero for PCI device is a target device to reassign,
3756 * or zero is not.
3757 */
3758int pci_is_reassigndev(struct pci_dev *dev)
3759{
3760 return (pci_specified_resource_alignment(dev) != 0);
3761}
3762
3763/* 3751/*
3764 * This function disables memory decoding and releases memory resources 3752 * This function disables memory decoding and releases memory resources
3765 * of the device specified by kernel's boot parameter 'pci=resource_alignment='. 3753 * of the device specified by kernel's boot parameter 'pci=resource_alignment='.
@@ -3774,7 +3762,9 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev)
3774 resource_size_t align, size; 3762 resource_size_t align, size;
3775 u16 command; 3763 u16 command;
3776 3764
3777 if (!pci_is_reassigndev(dev)) 3765 /* check if specified PCI is target device to reassign */
3766 align = pci_specified_resource_alignment(dev);
3767 if (!align)
3778 return; 3768 return;
3779 3769
3780 if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL && 3770 if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
@@ -3790,7 +3780,6 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev)
3790 command &= ~PCI_COMMAND_MEMORY; 3780 command &= ~PCI_COMMAND_MEMORY;
3791 pci_write_config_word(dev, PCI_COMMAND, command); 3781 pci_write_config_word(dev, PCI_COMMAND, command);
3792 3782
3793 align = pci_specified_resource_alignment(dev);
3794 for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) { 3783 for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) {
3795 r = &dev->resource[i]; 3784 r = &dev->resource[i];
3796 if (!(r->flags & IORESOURCE_MEM)) 3785 if (!(r->flags & IORESOURCE_MEM))
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index b42133afca98..31063ac30992 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -272,7 +272,7 @@ static int get_port_device_capability(struct pci_dev *dev)
272 272
273 /* Hot-Plug Capable */ 273 /* Hot-Plug Capable */
274 if ((cap_mask & PCIE_PORT_SERVICE_HP) && 274 if ((cap_mask & PCIE_PORT_SERVICE_HP) &&
275 dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT) { 275 pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT) {
276 pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32); 276 pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
277 if (reg32 & PCI_EXP_SLTCAP_HPC) { 277 if (reg32 & PCI_EXP_SLTCAP_HPC) {
278 services |= PCIE_PORT_SERVICE_HP; 278 services |= PCIE_PORT_SERVICE_HP;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 056d3d66b976..7e87b1ed2175 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1697,12 +1697,21 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
1697} 1697}
1698 1698
1699/** 1699/**
1700 * pcie_caps_reg - get the PCIe Capabilities Register
1701 * @dev: PCI device
1702 */
1703static inline u16 pcie_caps_reg(const struct pci_dev *dev)
1704{
1705 return dev->pcie_flags_reg;
1706}
1707
1708/**
1700 * pci_pcie_type - get the PCIe device/port type 1709 * pci_pcie_type - get the PCIe device/port type
1701 * @dev: PCI device 1710 * @dev: PCI device
1702 */ 1711 */
1703static inline int pci_pcie_type(const struct pci_dev *dev) 1712static inline int pci_pcie_type(const struct pci_dev *dev)
1704{ 1713{
1705 return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4; 1714 return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
1706} 1715}
1707 1716
1708void pci_request_acs(void); 1717void pci_request_acs(void);