]> git.itanic.dy.fi Git - linux-stable/commitdiff
PCI: Let pcibios_root_bridge_prepare() access bridge->windows
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Tue, 7 Dec 2021 10:49:20 +0000 (11:49 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 12 Jan 2022 21:37:10 +0000 (15:37 -0600)
When pci_register_host_bridge() is called, bridge->windows are already
available. However these windows are being moved temporarily from there.

To let pcibios_root_bridge_prepare() have access to these windows, move the
windows movement after calling this function. This is useful for the MIPS
ralink mt7621 platform so it can set up I/O coherence units and avoid
custom MIPS code in the mt7621 PCIe controller driver.

Link: https://lore.kernel.org/r/20211207104924.21327-2-sergio.paracuellos@gmail.com
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
drivers/pci/probe.c

index 087d3658f75cef27021d10fc402896ff14b46a57..372a70efccc669842544e43ee9f9fb5c8f39165e 100644 (file)
@@ -898,8 +898,6 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
 
        bridge->bus = bus;
 
-       /* Temporarily move resources off the list */
-       list_splice_init(&bridge->windows, &resources);
        bus->sysdata = bridge->sysdata;
        bus->ops = bridge->ops;
        bus->number = bus->busn_res.start = bridge->busnr;
@@ -925,6 +923,8 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
        if (err)
                goto free;
 
+       /* Temporarily move resources off the list */
+       list_splice_init(&bridge->windows, &resources);
        err = device_add(&bridge->dev);
        if (err) {
                put_device(&bridge->dev);