Skip to content

Commit 479a42e

Browse files
Terry Trittongregkh
authored andcommitted
Revert "PCI: Use preserve_config in place of pci_flags"
This reverts commit f858b0f which is commit 7246a4520b4bf1494d7d030166a11b5226f6d508 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.1 branch by itself. The other patches do not apply cleanly to the 6.1 branch. Signed-off-by: Terry Tritton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6603aca commit 479a42e

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
@@ -3082,18 +3082,20 @@ int pci_host_probe(struct pci_host_bridge *bridge)
30823082

30833083
bus = bridge->bus;
30843084

3085-
/* If we must preserve the resource configuration, claim now */
3086-
if (bridge->preserve_config)
3087-
pci_bus_claim_resources(bus);
3088-
30893085
/*
3090-
* Assign whatever was left unassigned. If we didn't claim above,
3091-
* this will reassign everything.
3086+
* We insert PCI resources into the iomem_resource and
3087+
* ioport_resource trees in either pci_bus_claim_resources()
3088+
* or pci_bus_assign_resources().
30923089
*/
3093-
pci_assign_unassigned_root_bus_resources(bus);
3090+
if (pci_has_flag(PCI_PROBE_ONLY)) {
3091+
pci_bus_claim_resources(bus);
3092+
} else {
3093+
pci_bus_size_bridges(bus);
3094+
pci_bus_assign_resources(bus);
30943095

3095-
list_for_each_entry(child, &bus->children, node)
3096-
pcie_bus_configure_settings(child);
3096+
list_for_each_entry(child, &bus->children, node)
3097+
pcie_bus_configure_settings(child);
3098+
}
30973099

30983100
pci_bus_add_devices(bus);
30993101
return 0;

0 commit comments

Comments
 (0)