lkml.org 
[lkml]   [2005]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch 146/198] pci enumeration on ixp2000: overflow in kernel/resource.c
From
Date

From: Lennert Buytenhek <buytenh@wantstofly.org>

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.

(akpm: pls. double-check)

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

25-akpm/kernel/resource.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN kernel/resource.c~pci-enumeration-on-ixp2000-overflow-in-kernel-resourcec kernel/resource.c
--- 25/kernel/resource.c~pci-enumeration-on-ixp2000-overflow-in-kernel-resourcec 2005-04-12 03:21:38.435293848 -0700
+++ 25-akpm/kernel/resource.c 2005-04-12 03:21:38.438293392 -0700
@@ -266,7 +266,7 @@ static int find_resource(struct resource
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-12 13:17    [W:0.033 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site