Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294698
b: refs/heads/master
c: 8424d75
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Jesse Barnes committed Feb 14, 2012
1 parent c7ab63e commit 6f66595
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 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: 3e6e0d80941773a6d0ac94354b083b74967f06fb
refs/heads/master: 8424d7592eab8245b51051ee458e598213bca3b2
18 changes: 12 additions & 6 deletions trunk/drivers/pci/setup-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,14 @@ static void __assign_resources_sorted(struct resource_list *head,
}

static void pdev_assign_resources_sorted(struct pci_dev *dev,
struct resource_list_x *add_head,
struct resource_list_x *fail_head)
{
struct resource_list head;

head.next = NULL;
__dev_sort_resources(dev, &head);
__assign_resources_sorted(&head, NULL, fail_head);
__assign_resources_sorted(&head, add_head, fail_head);

}

Expand Down Expand Up @@ -1006,17 +1007,19 @@ void __ref pci_bus_assign_resources(const struct pci_bus *bus)
EXPORT_SYMBOL(pci_bus_assign_resources);

static void __ref __pci_bridge_assign_resources(const struct pci_dev *bridge,
struct resource_list_x *add_head,
struct resource_list_x *fail_head)
{
struct pci_bus *b;

pdev_assign_resources_sorted((struct pci_dev *)bridge, fail_head);
pdev_assign_resources_sorted((struct pci_dev *)bridge,
add_head, fail_head);

b = bridge->subordinate;
if (!b)
return;

__pci_bus_assign_resources(b, NULL, fail_head);
__pci_bus_assign_resources(b, add_head, fail_head);

switch (bridge->class >> 8) {
case PCI_CLASS_BRIDGE_PCI:
Expand Down Expand Up @@ -1291,18 +1294,21 @@ pci_assign_unassigned_resources(void)
void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
{
struct pci_bus *parent = bridge->subordinate;
struct resource_list_x add_list; /* list of resources that
want additional resources */
int tried_times = 0;
struct resource_list_x head, *list;
int retval;
unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
IORESOURCE_PREFETCH;

head.next = NULL;
add_list.next = NULL;

again:
pci_bus_size_bridges(parent);
__pci_bridge_assign_resources(bridge, &head);

__pci_bus_size_bridges(parent, &add_list);
__pci_bridge_assign_resources(bridge, &add_list, &head);
BUG_ON(add_list.next);
tried_times++;

if (!head.next)
Expand Down

0 comments on commit 6f66595

Please sign in to comment.