Commit 7c090e5b authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes

mips/PCI: convert to pci_scan_root_bus() for correct root bus resources

Convert from pci_scan_bus() to pci_scan_root_bus() and remove root bus
resource fixups.  This fixes the problem of "early" and "header" quirks
seeing incorrect root bus resources.

Based on original patch by Deng-Cheng Zhu.

Reference: https://lkml.org/lkml/2011/8/26/89
CC: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarDeng-Cheng Zhu <dczhu@mips.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 4723b984
...@@ -81,6 +81,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose) ...@@ -81,6 +81,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
{ {
static int next_busno; static int next_busno;
static int need_domain_info; static int need_domain_info;
LIST_HEAD(resources);
struct pci_bus *bus; struct pci_bus *bus;
if (!hose->iommu) if (!hose->iommu)
...@@ -89,7 +90,13 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose) ...@@ -89,7 +90,13 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
if (hose->get_busno && pci_probe_only) if (hose->get_busno && pci_probe_only)
next_busno = (*hose->get_busno)(); next_busno = (*hose->get_busno)();
bus = pci_scan_bus(next_busno, hose->pci_ops, hose); pci_add_resource(&resources, hose->mem_resource);
pci_add_resource(&resources, hose->io_resource);
bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
&resources);
if (!bus)
pci_free_resource_list(&resources);
hose->bus = bus; hose->bus = bus;
need_domain_info = need_domain_info || hose->index; need_domain_info = need_domain_info || hose->index;
...@@ -245,15 +252,11 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) ...@@ -245,15 +252,11 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
{ {
/* Propagate hose info into the subordinate devices. */ /* Propagate hose info into the subordinate devices. */
struct pci_controller *hose = bus->sysdata;
struct list_head *ln; struct list_head *ln;
struct pci_dev *dev = bus->self; struct pci_dev *dev = bus->self;
if (!dev) { if (pci_probe_only && dev &&
bus->resource[0] = hose->io_resource; (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
bus->resource[1] = hose->mem_resource;
} else if (pci_probe_only &&
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
pci_read_bridge_bases(bus); pci_read_bridge_bases(bus);
pcibios_fixup_device_resources(dev, bus); pcibios_fixup_device_resources(dev, bus);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment