aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2012-01-21 05:08:22 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2012-02-14 11:44:53 -0500
commit2f320521a0d2d11fb857be09d05e2fbbf3ef8c13 (patch)
tree9b8d91f3d64f383405511c33fd4d9c5d4aaa20c2 /drivers/pci/pci-sysfs.c
parent8424d7592eab8245b51051ee458e598213bca3b2 (diff)
PCI: Make rescan bus increase bridge resource size if needed
Current rescan will not touch bridge MMIO and IO. Try to reuse pci_assign_unassigned_bridge_resources(bridge) to update bridge resources, if child devices need more resources. Only do that for bridges whose children are all removed already; i.e. don't release resources that could already be in use by drivers on child devices. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index a3cd8cad532a..d9723039e99a 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -366,7 +366,10 @@ dev_bus_rescan_store(struct device *dev, struct device_attribute *attr,
366 366
367 if (val) { 367 if (val) {
368 mutex_lock(&pci_remove_rescan_mutex); 368 mutex_lock(&pci_remove_rescan_mutex);
369 pci_rescan_bus(bus); 369 if (!pci_is_root_bus(bus) && list_empty(&bus->devices))
370 pci_rescan_bus_bridge_resize(bus->self);
371 else
372 pci_rescan_bus(bus);
370 mutex_unlock(&pci_remove_rescan_mutex); 373 mutex_unlock(&pci_remove_rescan_mutex);
371 } 374 }
372 return count; 375 return count;