aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2013-07-22 17:37:18 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-07-25 14:35:03 -0400
commit39772038ea93e85ea4f1307ec9c1f48a063d89a0 (patch)
tree310d32883c16365b532448a434a7b834f0d6404b
parentff35147cf15814e13c62831f6910f8663e4dc91e (diff)
PCI: Assign resources for hot-added host bridge more aggressively
When hot-adding an ACPI host bridge, use pci_assign_unassigned_root_bus_resources() instead of pci_assign_unassigned_bus_resources(). The former is more aggressive and will release and reassign existing resources if necessary. This is safe at hot-add time because no drivers are bound to devices below the new host bridge yet. [bhelgaas: changelog, split __init changes out for reviewability] Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/acpi/pci_root.c2
-rw-r--r--drivers/pci/setup-bus.c2
-rw-r--r--include/linux/pci.h1
3 files changed, 3 insertions, 2 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index faa1d29c0261..ce04eb28e029 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -526,7 +526,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
526 526
527 if (system_state != SYSTEM_BOOTING) { 527 if (system_state != SYSTEM_BOOTING) {
528 pcibios_resource_survey_bus(root->bus); 528 pcibios_resource_survey_bus(root->bus);
529 pci_assign_unassigned_bus_resources(root->bus); 529 pci_assign_unassigned_root_bus_resources(root->bus);
530 } 530 }
531 531
532 pci_bus_add_devices(root->bus); 532 pci_bus_add_devices(root->bus);
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 8d1e654256a8..94b777d108bb 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1395,7 +1395,7 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus,
1395 * second and later try will clear small leaf bridge res 1395 * second and later try will clear small leaf bridge res
1396 * will stop till to the max deepth if can not find good one 1396 * will stop till to the max deepth if can not find good one
1397 */ 1397 */
1398static void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus) 1398void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
1399{ 1399{
1400 LIST_HEAD(realloc_head); /* list of resources that 1400 LIST_HEAD(realloc_head); /* list of resources that
1401 want additional resources */ 1401 want additional resources */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8cd1e6f30acd..e494c90a00d1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1003,6 +1003,7 @@ int pci_claim_resource(struct pci_dev *, int);
1003void pci_assign_unassigned_resources(void); 1003void pci_assign_unassigned_resources(void);
1004void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); 1004void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
1005void pci_assign_unassigned_bus_resources(struct pci_bus *bus); 1005void pci_assign_unassigned_bus_resources(struct pci_bus *bus);
1006void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus);
1006void pdev_enable_device(struct pci_dev *); 1007void pdev_enable_device(struct pci_dev *);
1007int pci_enable_resources(struct pci_dev *, int mask); 1008int pci_enable_resources(struct pci_dev *, int mask);
1008void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 1009void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),