[PATCH 3/4] pci: Do not auto-enable PCI reallocation when _DSM #5 returns 0

Benjamin Herrenschmidt
2019-06-15T00:30:05Z

This prevents auto-enabling of bridges reallocation when the FW tells
us that the initial configuration must be preserved for a given host
bridge.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/pci/setup-bus.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 0cdd5ff389de..049a5602b942 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1684,10 +1684,16 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus,
enum enable_type enable_local)
{
bool unassigned = false;
+ struct pci_host_bridge *hb;

if (enable_local != undefined)
return enable_local;

+ /* Don't realloc if ACPI tells us not to */
+ hb = pci_find_host_bridge(bus);
+ if (hb->preserve_config)
+ return auto_disabled;
+
pci_walk_bus(bus, iov_resources_unassigned, &unassigned);
if (unassigned)
return auto_enabled;
--
2.17.1