Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358387
b: refs/heads/master
c: 83edc87
h: refs/heads/master
i:
  358385: c2d9ab5
  358383: 7ba8e81
v: v3
  • Loading branch information
Yinghai Lu authored and Bjorn Helgaas committed Jan 7, 2013
1 parent 8ddd6b5 commit cf230fd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c7f4bbc92feee2986212ef3b42c806e2257197dc
refs/heads/master: 83edc87ce8b284a3d60ab8072e55041c76a68277
38 changes: 25 additions & 13 deletions trunk/arch/x86/pci/i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,15 @@ static void __init pcibios_allocate_bridge_resources(struct pci_dev *dev)
}
}

static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
static void __init pcibios_allocate_bus_resources(struct pci_bus *bus)
{
struct pci_bus *bus;
struct pci_bus *child;

/* Depth-First Search on bus tree */
list_for_each_entry(bus, bus_list, node) {
if (bus->self)
pcibios_allocate_bridge_resources(bus->self);
pcibios_allocate_bus_resources(&bus->children);
}
if (bus->self)
pcibios_allocate_bridge_resources(bus->self);
list_for_each_entry(child, &bus->children, node)
pcibios_allocate_bus_resources(child);
}

struct pci_check_idx_range {
Expand Down Expand Up @@ -285,12 +284,18 @@ static void __init pcibios_allocate_dev_resources(struct pci_dev *dev, int pass)
}
}

static void __init pcibios_allocate_resources(int pass)
static void __init pcibios_allocate_resources(struct pci_bus *bus, int pass)
{
struct pci_dev *dev = NULL;
struct pci_dev *dev;
struct pci_bus *child;

for_each_pci_dev(dev)
list_for_each_entry(dev, &bus->devices, bus_list) {
pcibios_allocate_dev_resources(dev, pass);

child = dev->subordinate;
if (child)
pcibios_allocate_resources(child, pass);
}
}

static int __init pcibios_assign_resources(void)
Expand Down Expand Up @@ -323,10 +328,17 @@ static int __init pcibios_assign_resources(void)

void __init pcibios_resource_survey(void)
{
struct pci_bus *bus;

DBG("PCI: Allocating resources\n");
pcibios_allocate_bus_resources(&pci_root_buses);
pcibios_allocate_resources(0);
pcibios_allocate_resources(1);

list_for_each_entry(bus, &pci_root_buses, node)
pcibios_allocate_bus_resources(bus);

list_for_each_entry(bus, &pci_root_buses, node)
pcibios_allocate_resources(bus, 0);
list_for_each_entry(bus, &pci_root_buses, node)
pcibios_allocate_resources(bus, 1);

e820_reserve_resources_late();
/*
Expand Down

0 comments on commit cf230fd

Please sign in to comment.