stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5.10] Revert "PCI: Use preserve_config in place of pci_flags"
@ 2025-01-17 15:15 Terry Tritton
  2025-01-18 19:40 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Terry Tritton @ 2025-01-17 15:15 UTC (permalink / raw)
  To: stable
  Cc: Terry Tritton, Greg KH, Vidya Sagar, Sasha Levin, Daniel Verkamp,
	Terry Tritton

This reverts commit 0dde3ae52a0dcc5cdfe2185ec58ec52b43fda22e 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 5.10 branch by itself.

The other patches do not apply cleanly to the 5.10 branch.

Signed-off-by: Terry Tritton <terry.tritton@linaro.org>
---
 drivers/pci/controller/pci-host-common.c |  4 ++++
 drivers/pci/probe.c                      | 20 +++++++++++---------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c
index 2525bd043261..6ce34a1deecb 100644
--- a/drivers/pci/controller/pci-host-common.c
+++ b/drivers/pci/controller/pci-host-common.c
@@ -71,6 +71,10 @@ int pci_host_common_probe(struct platform_device *pdev)
 	if (IS_ERR(cfg))
 		return PTR_ERR(cfg);
 
+	/* Do not reassign resources if probe only */
+	if (!pci_has_flag(PCI_PROBE_ONLY))
+		pci_add_flags(PCI_REASSIGN_ALL_BUS);
+
 	bridge->sysdata = cfg;
 	bridge->ops = (struct pci_ops *)&ops->pci_ops;
 
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index b0ac721e047d..02a75f3b5920 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -3018,18 +3018,20 @@ int pci_host_probe(struct pci_host_bridge *bridge)
 
 	bus = bridge->bus;
 
-	/* If we must preserve the resource configuration, claim now */
-	if (bridge->preserve_config)
-		pci_bus_claim_resources(bus);
-
 	/*
-	 * Assign whatever was left unassigned. If we didn't claim above,
-	 * this will reassign everything.
+	 * We insert PCI resources into the iomem_resource and
+	 * ioport_resource trees in either pci_bus_claim_resources()
+	 * or pci_bus_assign_resources().
 	 */
-	pci_assign_unassigned_root_bus_resources(bus);
+	if (pci_has_flag(PCI_PROBE_ONLY)) {
+		pci_bus_claim_resources(bus);
+	} else {
+		pci_bus_size_bridges(bus);
+		pci_bus_assign_resources(bus);
 
-	list_for_each_entry(child, &bus->children, node)
-		pcie_bus_configure_settings(child);
+		list_for_each_entry(child, &bus->children, node)
+			pcie_bus_configure_settings(child);
+	}
 
 	pci_bus_add_devices(bus);
 	return 0;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 5.10] Revert "PCI: Use preserve_config in place of pci_flags"
  2025-01-17 15:15 [PATCH 5.10] Revert "PCI: Use preserve_config in place of pci_flags" Terry Tritton
@ 2025-01-18 19:40 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2025-01-18 19:40 UTC (permalink / raw)
  To: stable; +Cc: Terry Tritton, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 7246a4520b4bf1494d7d030166a11b5226f6d508

WARNING: Author mismatch between patch and upstream commit:
Backport author: Terry Tritton<terry.tritton@linaro.org>
Commit author: Vidya Sagar<vidyas@nvidia.com>


Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.6.y | Present (different SHA1: 3e221877dd92)
6.1.y | Present (different SHA1: f858b0fab28d)
5.15.y | Present (different SHA1: c1a1393f7844)
5.10.y | Present (different SHA1: 0dde3ae52a0d)

Note: The patch differs from the upstream commit:
---
1:  7246a4520b4bf < -:  ------------- PCI: Use preserve_config in place of pci_flags
-:  ------------- > 1:  367f98ddc0072 Revert "PCI: Use preserve_config in place of pci_flags"
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.10.y       |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-18 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 15:15 [PATCH 5.10] Revert "PCI: Use preserve_config in place of pci_flags" Terry Tritton
2025-01-18 19:40 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).