aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.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/probe.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/probe.c')
-rw-r--r--drivers/pci/probe.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 71eac9cd724d..0e84e8c2a6d0 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1667,6 +1667,31 @@ EXPORT_SYMBOL(pci_scan_bus);
1667 1667
1668#ifdef CONFIG_HOTPLUG 1668#ifdef CONFIG_HOTPLUG
1669/** 1669/**
1670 * pci_rescan_bus_bridge_resize - scan a PCI bus for devices.
1671 * @bridge: PCI bridge for the bus to scan
1672 *
1673 * Scan a PCI bus and child buses for new devices, add them,
1674 * and enable them, resizing bridge mmio/io resource if necessary
1675 * and possible. The caller must ensure the child devices are already
1676 * removed for resizing to occur.
1677 *
1678 * Returns the max number of subordinate bus discovered.
1679 */
1680unsigned int __ref pci_rescan_bus_bridge_resize(struct pci_dev *bridge)
1681{
1682 unsigned int max;
1683 struct pci_bus *bus = bridge->subordinate;
1684
1685 max = pci_scan_child_bus(bus);
1686
1687 pci_assign_unassigned_bridge_resources(bridge);
1688
1689 pci_bus_add_devices(bus);
1690
1691 return max;
1692}
1693
1694/**
1670 * pci_rescan_bus - scan a PCI bus for devices. 1695 * pci_rescan_bus - scan a PCI bus for devices.
1671 * @bus: PCI bus to scan 1696 * @bus: PCI bus to scan
1672 * 1697 *