linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci hotplug: rescan bridge after device hotplug
@ 2012-05-22 20:11 Jason Baron
  2012-05-22 20:34 ` Yinghai Lu
  2012-05-22 21:21 ` Yinghai Lu
  0 siblings, 2 replies; 20+ messages in thread
From: Jason Baron @ 2012-05-22 20:11 UTC (permalink / raw)
  To: bhelgaas, linux-pci; +Cc: mst

I'm tyring to support bridge hotplug and devices below it in qemu via acpi
hotplug. Currently only 1 level or 32 slots are supported. By allowing for a
second level, we will be able to support 32^2 devices.

If I first hotplug the bridge with no devices intially below it, the hotplug
code sets the bridge memory window to 0 and does not increase it when
subsequent devices are added below it.

Fix this, by calling pci_rescan_bus_bridge_resize(), on the bridge directly
below the root to re-size all the birdge windows that may have changed.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 drivers/pci/hotplug/acpiphp_glue.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 806c44f..8960c1e 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -792,6 +792,7 @@ static int __ref enable_device(struct acpiphp_slot *slot)
 {
 	struct pci_dev *dev;
 	struct pci_bus *bus = slot->bridge->pci_bus;
+	struct pci_bus *rescan_bus;
 	struct acpiphp_func *func;
 	int retval = 0;
 	int num, max, pass;
@@ -821,6 +822,13 @@ static int __ref enable_device(struct acpiphp_slot *slot)
 		}
 	}
 
+	/* Ensure we rescan/setup a bridge for new devs hanging off of it */
+	rescan_bus = bus;
+	while (rescan_bus->parent && rescan_bus->parent->self)
+		rescan_bus = rescan_bus->parent;
+	if (rescan_bus->self)
+		pci_rescan_bus_bridge_resize(rescan_bus->self);
+
 	list_for_each_entry(func, &slot->funcs, sibling)
 		acpiphp_bus_add(func);
 
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-05-24 13:44 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-22 20:11 [PATCH] pci hotplug: rescan bridge after device hotplug Jason Baron
2012-05-22 20:34 ` Yinghai Lu
2012-05-22 21:18   ` Yinghai Lu
2012-05-22 21:21 ` Yinghai Lu
2012-05-23  2:43   ` Jason Baron
2012-05-23  3:31     ` Yinghai Lu
2012-05-23  4:07       ` Yinghai Lu
2012-05-23 15:53         ` Jason Baron
2012-05-23 17:16           ` Yinghai Lu
2012-05-23 18:44             ` Jason Baron
2012-05-23 19:08               ` Michael S. Tsirkin
2012-05-23 19:20                 ` Michael S. Tsirkin
2012-05-23 20:53                 ` Yinghai Lu
2012-05-23 21:18                   ` Michael S. Tsirkin
2012-05-23 20:31               ` Yinghai Lu
2012-05-23 20:49                 ` Michael S. Tsirkin
2012-05-23 19:13       ` Michael S. Tsirkin
2012-05-23 20:52       ` Jason Baron
2012-05-24  0:00         ` Yinghai Lu
2012-05-24 13:43           ` Jason Baron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).