<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From akpm@osdl.org Thu Apr 28 00:28:06 2005
Subject: [patch 09/20] acpi bridge hotadd: Remove hot-plugged devices that could not be allocated resources
To: greg@kroah.com
Cc: akpm@osdl.org, rajesh.shah@intel.com
From: akpm@osdl.org
Date: Thu, 28 Apr 2005 00:25:50 -0700


From: Rajesh Shah &lt;rajesh.shah@intel.com&gt;

When hot-plugging an I/O hierarchy that contains many bridges and leaf
devices, it's possible that there are not enough resources to start all the
device present.  If we fail to assign a resource, clear the corresponding
value in the pci_dev structure, so other code can take corrective action.

Signed-off-by: Rajesh Shah &lt;rajesh.shah@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

---
 drivers/pci/setup-bus.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

--- gregkh-2.6.orig/drivers/pci/setup-bus.c	2005-04-06 11:47:47.000000000 -0700
+++ gregkh-2.6/drivers/pci/setup-bus.c	2005-05-03 22:28:31.000000000 -0700
@@ -72,7 +72,10 @@
 	for (list = head.next; list;) {
 		res = list-&gt;res;
 		idx = res - &amp;list-&gt;dev-&gt;resource[0];
-		pci_assign_resource(list-&gt;dev, idx);
+		if (pci_assign_resource(list-&gt;dev, idx)) {
+			res-&gt;start = 0;
+			res-&gt;flags = 0;
+		}
 		tmp = list;
 		list = list-&gt;next;
 		kfree(tmp);
</pre></body></html>