aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 11:09:15 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 11:09:15 -0400
commitff0972c26bbf209da6f6d244cce60e695df863f6 (patch)
tree79db41583bf3847139ace7a6d1eff0266ea63bc2 /kernel
parenta09fc446fb6d541281d9559fe7215d7c0d3cc9ce (diff)
parentc9d86d76c1cdd76d67292ab75643db66573ca7dd (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (28 commits) pciehp - fix wrong return value IA64: PCI: dont disable irq which is not enabled acpiphp: add support for ioapic hot-remove PCI: assign ioapic resource at hotplug acpiphp: disable bridges acpiphp: stop bus device before acpi_bus_trim PCI: add pci_stop_bus_device acpiphp: do not initialize existing ioapics acpiphp: initialize ioapics before starting devices acpiphp: set hpp values before starting devices PCI Hotplug: cleanup pcihp skeleton code. PCI: Restore PCI Express capability registers after PM event PCI: drivers/pci/hotplug/acpiphp_glue.c: make a function static PCI: Multiprobe sanitizer PCI: fix __must_check warnings PCI Hotplug: fix __must_check warnings SHPCHP: fix __must_check warnings PCI-Express AER implemetation: pcie_portdrv error handler PCI-Express AER implemetation: AER core and aerdriver PCI-Express AER implemetation: export pcie_port_bus_type ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/resource.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 46286434af80..9db38a1a7520 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -344,12 +344,11 @@ EXPORT_SYMBOL(allocate_resource);
344 * 344 *
345 * Returns 0 on success, -EBUSY if the resource can't be inserted. 345 * Returns 0 on success, -EBUSY if the resource can't be inserted.
346 * 346 *
347 * This function is equivalent of request_resource when no conflict 347 * This function is equivalent to request_resource when no conflict
348 * happens. If a conflict happens, and the conflicting resources 348 * happens. If a conflict happens, and the conflicting resources
349 * entirely fit within the range of the new resource, then the new 349 * entirely fit within the range of the new resource, then the new
350 * resource is inserted and the conflicting resources become childs of 350 * resource is inserted and the conflicting resources become children of
351 * the new resource. Otherwise the new resource becomes the child of 351 * the new resource.
352 * the conflicting resource
353 */ 352 */
354int insert_resource(struct resource *parent, struct resource *new) 353int insert_resource(struct resource *parent, struct resource *new)
355{ 354{
@@ -357,20 +356,21 @@ int insert_resource(struct resource *parent, struct resource *new)
357 struct resource *first, *next; 356 struct resource *first, *next;
358 357
359 write_lock(&resource_lock); 358 write_lock(&resource_lock);
360 begin:
361 result = 0;
362 first = __request_resource(parent, new);
363 if (!first)
364 goto out;
365 359
366 result = -EBUSY; 360 for (;; parent = first) {
367 if (first == parent) 361 result = 0;
368 goto out; 362 first = __request_resource(parent, new);
363 if (!first)
364 goto out;
369 365
370 /* Resource fully contained by the clashing resource? Recurse into it */ 366 result = -EBUSY;
371 if (first->start <= new->start && first->end >= new->end) { 367 if (first == parent)
372 parent = first; 368 goto out;
373 goto begin; 369
370 if ((first->start > new->start) || (first->end < new->end))
371 break;
372 if ((first->start == new->start) && (first->end == new->end))
373 break;
374 } 374 }
375 375
376 for (next = first; ; next = next->sibling) { 376 for (next = first; ; next = next->sibling) {