Skip to contentSkip to conversation

PCI MPS settings on rescan

PATCH New Jon Derrick 1 participant 2 messages Oct 15, 2018 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI MPS settings on rescan

Hi Bjorn, Lorenzo,

This is an alternative patch to the VMD-targeted patch to perform MPS setting generically for callers of pci_rescan_bus.

Ref:
https://patchwork.ozlabs.org/patch/966129/

Jon Derrick (1):
PCI: Configure MPS on rescan

 drivers/pci/probe.c | 3 +++
 1 file changed, 3 insertions(+)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 PCI: Configure MPS on rescan

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.

---
 drivers/pci/probe.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/pci/probe.c +3 -0
index 201f9e5..c0406d9 100644
@@ -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;
Signature · 1 line
1.8.3.1