diff mbox series

PCI: Configure MPS on rescan

Message ID 1539614250-2749-2-git-send-email-jonathan.derrick@intel.com
State Superseded
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Configure MPS on rescan | expand

Commit Message

Jon Derrick Oct. 15, 2018, 2:37 p.m. UTC
During pci_rescan_bus(), we may encounter new busses and devices which
don't have MPS set for compatibility. Using this path, newly discovered
busses and devices would then require their MPS to be configured after
driver attachment, which will often be too later for drivers which do
memory transactions on probe. This additionally ensures that any
pcie_bus_config kernel settings will be applied to the busses and devices
discovered through this path prior to driver attachment.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
---
 drivers/pci/probe.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 201f9e5..c0406d9 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -3149,10 +3149,13 @@  unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge)
  */
 unsigned int pci_rescan_bus(struct pci_bus *bus)
 {
+	struct pci_bus *child;
 	unsigned int max;
 
 	max = pci_scan_child_bus(bus);
 	pci_assign_unassigned_bus_resources(bus);
+	list_for_each_entry(child, &bus->children, node)
+		pcie_bus_configure_settings(child);
 	pci_bus_add_devices(bus);
 
 	return max;