lkml.org 
[lkml]   [2005]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] pci enumeration on ixp2000: overflow in kernel/resource.c
(please CC, not on the list)

Hi all,

IXP2000 (ARM-based) platforms use a separate 'struct resource' for PCI
MEM space. Resource allocation for PCI BARs always fails because the
'root' resource (the IXP2000 PCI MEM resource) always has the entire
address space (00000000-ffffffff) free, and find_resource() calculates
the size of that range as ffffffff-00000000+1=0, so all allocations
fail because it thinks there is no space.

Comments? Can find_resource ever be called with size=0?


cheers,
Lennert


diff -urN linux-2.6.11.orig/kernel/resource.c linux-2.6.11/kernel/resource.c
--- linux-2.6.11.orig/kernel/resource.c 2005-03-02 08:38:13.000000000 +0100
+++ linux-2.6.11/kernel/resource.c 2005-04-07 11:58:26.000000000 +0200
@@ -266,7 +266,7 @@
new->start = (new->start + align - 1) & ~(align - 1);
if (alignf)
alignf(alignf_data, new, size, align);
- if (new->start < new->end && new->end - new->start + 1 >= size) {
+ if (new->start < new->end && new->end - new->start >= size - 1) {
new->end = new->start + size - 1;
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-04-09 11:19    [W:0.034 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site