linux/drivers/pci
Yijing Wang d4aa68f614 PCI: Don't restrict MPS for slots below Root Ports
When booting with "pci=pcie_bus_safe", we previously limited the
fabric MPS to 128 when we found:

  (1) A hotplug-capable Downstream Port ("dev->is_hotplug_bridge &&
      pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT"), or

  (2) A hotplug-capable Root Port with a slot that was either empty or
      contained a multi-function device ("dev->is_hotplug_bridge &&
      !list_is_singular(&dev->bus->devices)")

Part (1) is valid, but part (2) is not.

After a hot-add in the slot below a Root Port, we can reconfigure all
MPS values in the fabric below the Root Port because the new device is
the only thing below the Root Port and there are no active drivers.
Therefore, there's no reason to limit the MPS for Root Ports, no
matter what's in the slot.

Test info:

    -+-[0000:40]-+-07.0-[0000:46]--+-00.0  Intel 82576 NIC
                                   \-00.1  Intel 82576 NIC

    0000:40:07.0 Root Port bridge to [bus 46] (MPS supported=256)
    0000:46:00.0 Endpoint                     (MPS supported=512)
    0000:46:00.1 Endpoint                     (MPS supported=512)

    # echo 0 > /sys/bus/pci/slots/7/power
    # echo 1 > /sys/bus/pci/slots/7/power
    pcieport 0000:40:07.0: PCI-E Max Payload Size set to 256/ 256 (was 256)
    pci 0000:46:00.0:      PCI-E Max Payload Size set to 256/ 512 (was 128)
    pci 0000:46:00.1:      PCI-E Max Payload Size set to 256/ 512 (was 128)

Before this change, we set MPS to 128 for the Root Port and both NICs
because the slot contained a multi-function device and

    dev->is_hotplug_bridge && !list_is_singular(&dev->bus->devices)

was true.  After this change, we set it to 256.

[bhelgaas: changelog, comments, split out upstream bridge check]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jon Mason <jdmason@kudzu.us>
2013-08-22 10:47:04 -06:00
..
host pci: Add PCIe driver for Samsung Exynos 2013-06-26 20:14:59 +02:00
hotplug PCI: Simplify pcie_bus_configure_settings() interface 2013-08-22 10:47:02 -06:00
pcie PCI changes for the v3.11 merge window: 2013-07-03 16:31:35 -07:00
access.c PCI: Fix PCI Express Capability accessors for PCI_EXP_FLAGS 2013-02-15 11:46:24 -07:00
ats.c Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-01-11 18:50:26 -08:00
bus.c PCI: Introduce pci_bus_{get|put}() to manage PCI bus reference count 2013-05-27 16:22:09 -06:00
host-bridge.c PCI: add host bridge release support 2012-04-30 14:52:43 -06:00
hotplug-pci.c PCI: hotplug: remove pci_do_scan_bus() 2012-06-13 15:42:27 -06:00
htirq.c pci: Fix files needing export.h for EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:31:22 -04:00
ioapic.c PCI: Convert ioapic.c to module_pci_driver 2013-05-27 17:05:28 -06:00
iov.c Merge branch 'pci/jiang-bus-lock-v3' into next 2013-06-14 17:47:46 -06:00
irq.c PCI: Convert dev_printk(KERN_<LEVEL> to dev_<level>( 2012-11-07 15:24:18 -07:00
Kconfig ARM SoC specific changes 2013-07-02 13:43:38 -07:00
Makefile pci: PCIe driver for Marvell Armada 370/XP systems 2013-05-20 19:18:44 +00:00
msi.c PCI: Allocate only as many MSI vectors as requested by driver 2013-05-28 11:31:16 -06:00
of.c PCI: OF: Don't crash when bridge parent is NULL. 2011-08-19 08:51:37 -07:00
pci-acpi.c PCI / ACPI / PM: Use correct power state strings in messages 2013-06-14 16:35:42 -06:00
pci-driver.c PM / Runtime: Rework the "runtime idle" helper routine 2013-06-03 21:49:52 +02:00
pci-label.c switch ->is_visible() to returning umode_t 2012-01-03 22:54:55 -05:00
pci-stub.c PCI: Convert dev_printk(KERN_<LEVEL> to dev_<level>( 2012-11-07 15:24:18 -07:00
pci-sysfs.c Merge branch 'pci/jiang-iov-fixes' into next 2013-06-05 12:27:19 -06:00
pci.c PCI: Remove unnecessary check for pcie_get_mps() failure 2013-08-22 10:47:03 -06:00
pci.h PCI / ACPI: Use boot-time resource allocation rules during hotplug 2013-06-23 01:01:35 +02:00
probe.c PCI: Don't restrict MPS for slots below Root Ports 2013-08-22 10:47:04 -06:00
proc.c pci/proc: switch to fixed_size_llseek() 2013-06-29 12:57:48 +04:00
quirks.c Merge branch 'pci/misc' into next 2013-06-26 15:55:52 -06:00
remove.c PCI: Add pcibios hooks for adding and removing PCI buses 2013-04-12 15:38:25 -06:00
rom.c PCI: Add PCI ROM helper for platform-provided ROM images 2013-03-26 17:19:41 -06:00
search.c PCI: Fix reference count leak in pci_dev_present() 2013-01-25 13:49:27 -07:00
setup-bus.c PCI / ACPI: Use boot-time resource allocation rules during hotplug 2013-06-23 01:01:35 +02:00
setup-irq.c PCI: Provide a default pcibios_update_irq() 2012-09-18 17:28:21 -06:00
setup-res.c PCI: Remove unused variables 2013-04-15 10:56:27 -06:00
slot.c PCI: Warn about failures instead of "must_check" functions 2013-04-17 10:21:12 -06:00
syscall.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
vpd.c pci: Fix files needing export.h for EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:31:22 -04:00
xen-pcifront.c xen/pcifront: Deal with toolstack missing 'XenbusStateClosing' state. 2013-06-14 12:28:59 -04:00