Skip to content

Commit 7246a45

Browse files
Vidya Sagarbjorn-helgaas
authored andcommitted
PCI: Use preserve_config in place of pci_flags
Use preserve_config in place of checking for PCI_PROBE_ONLY flag to enable support for "linux,pci-probe-only" on a per host bridge basis. This also obviates the use of adding PCI_REASSIGN_ALL_BUS flag if !PCI_PROBE_ONLY, as pci_assign_unassigned_root_bus_resources() takes care of reassigning the resources that are not already claimed. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vidya Sagar <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 1e69224 commit 7246a45

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

drivers/pci/controller/pci-host-common.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ int pci_host_common_probe(struct platform_device *pdev)
7373
if (IS_ERR(cfg))
7474
return PTR_ERR(cfg);
7575

76-
/* Do not reassign resources if probe only */
77-
if (!pci_has_flag(PCI_PROBE_ONLY))
78-
pci_add_flags(PCI_REASSIGN_ALL_BUS);
79-
8076
bridge->sysdata = cfg;
8177
bridge->ops = (struct pci_ops *)&ops->pci_ops;
8278
bridge->msi_domain = true;

drivers/pci/probe.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,20 +3094,18 @@ int pci_host_probe(struct pci_host_bridge *bridge)
30943094

30953095
bus = bridge->bus;
30963096

3097+
/* If we must preserve the resource configuration, claim now */
3098+
if (bridge->preserve_config)
3099+
pci_bus_claim_resources(bus);
3100+
30973101
/*
3098-
* We insert PCI resources into the iomem_resource and
3099-
* ioport_resource trees in either pci_bus_claim_resources()
3100-
* or pci_bus_assign_resources().
3102+
* Assign whatever was left unassigned. If we didn't claim above,
3103+
* this will reassign everything.
31013104
*/
3102-
if (pci_has_flag(PCI_PROBE_ONLY)) {
3103-
pci_bus_claim_resources(bus);
3104-
} else {
3105-
pci_bus_size_bridges(bus);
3106-
pci_bus_assign_resources(bus);
3105+
pci_assign_unassigned_root_bus_resources(bus);
31073106

3108-
list_for_each_entry(child, &bus->children, node)
3109-
pcie_bus_configure_settings(child);
3110-
}
3107+
list_for_each_entry(child, &bus->children, node)
3108+
pcie_bus_configure_settings(child);
31113109

31123110
pci_bus_add_devices(bus);
31133111
return 0;

0 commit comments

Comments
 (0)