2fbbf9a7aa5d5ab571a40df88f71d3544036eec0
[openwrt/staging/blogic.git] /
1 From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
2 Date: Tue, 7 Dec 2021 11:49:20 +0100
3 Subject: [PATCH] PCI: Let pcibios_root_bridge_prepare() access bridge->windows
4
5 When pci_register_host_bridge() is called, bridge->windows are already
6 available. However these windows are being moved temporarily from there.
7
8 To let pcibios_root_bridge_prepare() have access to these windows, move the
9 windows movement after calling this function. This is useful for the MIPS
10 ralink mt7621 platform so it can set up I/O coherence units and avoid
11 custom MIPS code in the mt7621 PCIe controller driver.
12
13 Link: https://lore.kernel.org/r/20211207104924.21327-2-sergio.paracuellos@gmail.com
14 Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
15 Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
16 Acked-by: Arnd Bergmann <arnd@arndb.de>
17 ---
18
19 --- a/drivers/pci/probe.c
20 +++ b/drivers/pci/probe.c
21 @@ -898,8 +898,6 @@ static int pci_register_host_bridge(stru
22
23 bridge->bus = bus;
24
25 - /* Temporarily move resources off the list */
26 - list_splice_init(&bridge->windows, &resources);
27 bus->sysdata = bridge->sysdata;
28 bus->ops = bridge->ops;
29 bus->number = bus->busn_res.start = bridge->busnr;
30 @@ -925,6 +923,8 @@ static int pci_register_host_bridge(stru
31 if (err)
32 goto free;
33
34 + /* Temporarily move resources off the list */
35 + list_splice_init(&bridge->windows, &resources);
36 err = device_add(&bridge->dev);
37 if (err) {
38 put_device(&bridge->dev);