]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
PCI: Don't auto-realloc if we're preserving firmware config
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sat, 15 Jun 2019 00:23:58 +0000 (10:23 +1000)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 21 Jun 2019 23:11:53 +0000 (18:11 -0500)
Prevent auto-enabling of bridges reallocation when the FW tells us that the
initial configuration must be preserved for a given host bridge.

Link: https://lore.kernel.org/r/20190615002359.29577-3-benh@kernel.crashing.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/setup-bus.c

index 0cdd5ff389de91ff4a011ab976155fa88a9b30e4..d533102b2788f3cdbed222fafe3d0847486b1f25 100644 (file)
@@ -1684,10 +1684,15 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus,
                                           enum enable_type enable_local)
 {
        bool unassigned = false;
+       struct pci_host_bridge *host;
 
        if (enable_local != undefined)
                return enable_local;
 
+       host = pci_find_host_bridge(bus);
+       if (host->preserve_config)
+               return auto_disabled;
+
        pci_walk_bus(bus, iov_resources_unassigned, &unassigned);
        if (unassigned)
                return auto_enabled;