PCI: honor child buses add_size in hot plug configuration
authorYinghai Lu <yinghai@kernel.org>
Mon, 25 Jul 2011 20:08:38 +0000 (13:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Oct 2012 15:27:27 +0000 (08:27 -0700)
commitfc3ef182a10cc554dcfdbe4e2b02a39831c50e57
treee3e96f37201b22f2dd331c66f72112b87b878af1
parent368d53159311622b2555a34666f8ecd7ab8da765
PCI: honor child buses add_size in hot plug configuration

commit be768912a49b10b68e96fbd8fa3cab0adfbd3091 upstream.

git commit c8adf9a3e873eddaaec11ac410a99ef6b9656938
    "PCI: pre-allocate additional resources to devices only after
successful allocation of essential resources."

fails to take into consideration the optional-resources needed by children
devices while calculating the optional-resource needed by the bridge.

This can be a problem on some setup. For example, if a hotplug bridge has 8
children hotplug bridges, the bridge should have enough resources to accomodate
the hotplug requirements for each of its children hotplug bridges.  Currently
this is not the case.

This patch fixes the problem.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Reviewed-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Andrew Worsley <amworsley@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/setup-bus.c