summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>2002-05-06 20:27:32 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-05-06 20:27:32 -0700
commit8a3d0b80edc3f9fa9766a2c46cbefd7954602408 (patch)
treec4d8c09bd08406ad5a24c5c4fa9ac34dabe4af52 /kernel
parent7c59354d546ae8c11228be80a255cb45d7f975f1 (diff)
[PATCH] 2.5.14: New PCI allocation code (alpha, arm, parisc) [1/2]
This changes PCI resource allocation algorithm to 3 passes vs. current 2 passes. Extra pass is used for calculation of required size and alignment of PCI buses behind PCI-PCI bridges. After that, in the pass #3, these buses get allocated like regular PCI devices. This gives tighter PCI IO and memory packing - for instance, this fixes allocation problems on certain alphas with very small (112Mb) PCI memory range. Also, the new code - will allow mixed approach to resource allocation: architecture can keep BIOS settings for some devices, and re-allocate resources for others, including improperly initialized bridges; - makes prefetchable ranges support much simpler; - allows sizing of IO and memory ranges for the host bridges, which might be very useful in some situations. It was tested on various alphas; I haven't heard any complaints from rmk and rth, so probably all of this is ok. :-) Part 1: - for all archs, 4th argument (align) added to pcibios_align_resource (and its callers). It's necessary because this function will be called for bus resources as well, and in this case size != alignment. - for several archs, dead/bogus code removed from pcibios_fixup_pbus_ranges().
Diffstat (limited to 'kernel')
-rw-r--r--kernel/resource.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 7804ab3230d1..bf331c1092ed 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -152,7 +152,8 @@ static int find_resource(struct resource *root, struct resource *new,
unsigned long size,
unsigned long min, unsigned long max,
unsigned long align,
- void (*alignf)(void *, struct resource *, unsigned long),
+ void (*alignf)(void *, struct resource *,
+ unsigned long, unsigned long),
void *alignf_data)
{
struct resource *this = root->child;
@@ -169,7 +170,7 @@ static int find_resource(struct resource *root, struct resource *new,
new->end = max;
new->start = (new->start + align - 1) & ~(align - 1);
if (alignf)
- alignf(alignf_data, new, size);
+ alignf(alignf_data, new, size, align);
if (new->start < new->end && new->end - new->start + 1 >= size) {
new->end = new->start + size - 1;
return 0;
@@ -189,7 +190,8 @@ int allocate_resource(struct resource *root, struct resource *new,
unsigned long size,
unsigned long min, unsigned long max,
unsigned long align,
- void (*alignf)(void *, struct resource *, unsigned long),
+ void (*alignf)(void *, struct resource *,
+ unsigned long, unsigned long),
void *alignf_data)
{
int err;