diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-01-21 05:08:21 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2012-02-14 11:44:52 -0500 |
commit | 8424d7592eab8245b51051ee458e598213bca3b2 (patch) | |
tree | 7c1dfe89c382ba8b9875382363a768172d5b6f90 /drivers/pci/setup-bus.c | |
parent | 3e6e0d80941773a6d0ac94354b083b74967f06fb (diff) |
PCI: Use add_list in pcie hotplug path.
We need add size for hot plug path when pluging in hotplug chassis
without cards.
-v2: change descriptions. make it applicable after "pci: Check bridge
resources after resource allocation."
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 7757c0026907..97c1eda96e64 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -330,13 +330,14 @@ requested_and_reassign: | |||
330 | } | 330 | } |
331 | 331 | ||
332 | static void pdev_assign_resources_sorted(struct pci_dev *dev, | 332 | static void pdev_assign_resources_sorted(struct pci_dev *dev, |
333 | struct resource_list_x *add_head, | ||
333 | struct resource_list_x *fail_head) | 334 | struct resource_list_x *fail_head) |
334 | { | 335 | { |
335 | struct resource_list head; | 336 | struct resource_list head; |
336 | 337 | ||
337 | head.next = NULL; | 338 | head.next = NULL; |
338 | __dev_sort_resources(dev, &head); | 339 | __dev_sort_resources(dev, &head); |
339 | __assign_resources_sorted(&head, NULL, fail_head); | 340 | __assign_resources_sorted(&head, add_head, fail_head); |
340 | 341 | ||
341 | } | 342 | } |
342 | 343 | ||
@@ -1006,17 +1007,19 @@ void __ref pci_bus_assign_resources(const struct pci_bus *bus) | |||
1006 | EXPORT_SYMBOL(pci_bus_assign_resources); | 1007 | EXPORT_SYMBOL(pci_bus_assign_resources); |
1007 | 1008 | ||
1008 | static void __ref __pci_bridge_assign_resources(const struct pci_dev *bridge, | 1009 | static void __ref __pci_bridge_assign_resources(const struct pci_dev *bridge, |
1010 | struct resource_list_x *add_head, | ||
1009 | struct resource_list_x *fail_head) | 1011 | struct resource_list_x *fail_head) |
1010 | { | 1012 | { |
1011 | struct pci_bus *b; | 1013 | struct pci_bus *b; |
1012 | 1014 | ||
1013 | pdev_assign_resources_sorted((struct pci_dev *)bridge, fail_head); | 1015 | pdev_assign_resources_sorted((struct pci_dev *)bridge, |
1016 | add_head, fail_head); | ||
1014 | 1017 | ||
1015 | b = bridge->subordinate; | 1018 | b = bridge->subordinate; |
1016 | if (!b) | 1019 | if (!b) |
1017 | return; | 1020 | return; |
1018 | 1021 | ||
1019 | __pci_bus_assign_resources(b, NULL, fail_head); | 1022 | __pci_bus_assign_resources(b, add_head, fail_head); |
1020 | 1023 | ||
1021 | switch (bridge->class >> 8) { | 1024 | switch (bridge->class >> 8) { |
1022 | case PCI_CLASS_BRIDGE_PCI: | 1025 | case PCI_CLASS_BRIDGE_PCI: |
@@ -1291,6 +1294,8 @@ enable_and_dump: | |||
1291 | void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge) | 1294 | void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge) |
1292 | { | 1295 | { |
1293 | struct pci_bus *parent = bridge->subordinate; | 1296 | struct pci_bus *parent = bridge->subordinate; |
1297 | struct resource_list_x add_list; /* list of resources that | ||
1298 | want additional resources */ | ||
1294 | int tried_times = 0; | 1299 | int tried_times = 0; |
1295 | struct resource_list_x head, *list; | 1300 | struct resource_list_x head, *list; |
1296 | int retval; | 1301 | int retval; |
@@ -1298,11 +1303,12 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge) | |||
1298 | IORESOURCE_PREFETCH; | 1303 | IORESOURCE_PREFETCH; |
1299 | 1304 | ||
1300 | head.next = NULL; | 1305 | head.next = NULL; |
1306 | add_list.next = NULL; | ||
1301 | 1307 | ||
1302 | again: | 1308 | again: |
1303 | pci_bus_size_bridges(parent); | 1309 | __pci_bus_size_bridges(parent, &add_list); |
1304 | __pci_bridge_assign_resources(bridge, &head); | 1310 | __pci_bridge_assign_resources(bridge, &add_list, &head); |
1305 | 1311 | BUG_ON(add_list.next); | |
1306 | tried_times++; | 1312 | tried_times++; |
1307 | 1313 | ||
1308 | if (!head.next) | 1314 | if (!head.next) |