106-v5.17-PCI-Let-pcibios_root_bridge_prepare-access-bridge-wi.patch 1.4 KB

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