Skip to content

Commit d85d484

Browse files
Terry TrittonBrian Maly
authored andcommitted
Revert "PCI: Use preserve_config in place of pci_flags"
This reverts commit c1a1393f7844c645389e5f1a3f1f0350e0fb9316 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 5.15 branch by itself. The other patches do not apply cleanly to the 5.15 branch. Signed-off-by: Terry Tritton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 39f320df353722086372abdcc2659e85afd52c3e) FOF: 0225 Signed-off-by: Brian Maly <[email protected]>
1 parent 75a884e commit d85d484

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

30693069
bus = bridge->bus;
30703070

3071-
/* If we must preserve the resource configuration, claim now */
3072-
if (bridge->preserve_config)
3073-
pci_bus_claim_resources(bus);
3074-
30753071
/*
3076-
* Assign whatever was left unassigned. If we didn't claim above,
3077-
* this will reassign everything.
3072+
* We insert PCI resources into the iomem_resource and
3073+
* ioport_resource trees in either pci_bus_claim_resources()
3074+
* or pci_bus_assign_resources().
30783075
*/
3079-
pci_assign_unassigned_root_bus_resources(bus);
3076+
if (pci_has_flag(PCI_PROBE_ONLY)) {
3077+
pci_bus_claim_resources(bus);
3078+
} else {
3079+
pci_bus_size_bridges(bus);
3080+
pci_bus_assign_resources(bus);
30803081

3081-
list_for_each_entry(child, &bus->children, node)
3082-
pcie_bus_configure_settings(child);
3082+
list_for_each_entry(child, &bus->children, node)
3083+
pcie_bus_configure_settings(child);
3084+
}
30833085

30843086
pci_bus_add_devices(bus);
30853087
return 0;

0 commit comments

Comments
 (0)