Skip to content

Commit bcb9678

Browse files
Terry Trittongregkh
authored andcommitted
Revert "PCI: Use preserve_config in place of pci_flags"
This reverts commit 3e22187 which is commit 7246a45 upstream. This patch causes a regression in cuttlefish/crossvm boot on arm64. The patch was part of a series that when applied will not cause a regression but this patch was backported to the 6.6 branch by itself. The other patches do not apply cleanly to the 6.6 branch. Signed-off-by: Terry Tritton <terry.tritton@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0cc84b6 commit bcb9678

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ 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+
7680
bridge->sysdata = cfg;
7781
bridge->ops = (struct pci_ops *)&ops->pci_ops;
7882
bridge->msi_domain = true;

drivers/pci/probe.c

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

30973097
bus = bridge->bus;
30983098

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

3109-
list_for_each_entry(child, &bus->children, node)
3110-
pcie_bus_configure_settings(child);
3110+
list_for_each_entry(child, &bus->children, node)
3111+
pcie_bus_configure_settings(child);
3112+
}
31113113

31123114
pci_bus_add_devices(bus);
31133115
return 0;

0 commit comments

Comments
 (0)