summaryrefslogtreecommitdiffstats
path: root/pci-v2-1-4-resources-ensure-alignment-callback-doesn-t-allocate-below-availab...
diff options
context:
space:
mode:
authorChuck Ebbert <cebbert@redhat.com>2010-09-23 21:40:59 -0400
committerChuck Ebbert <cebbert@redhat.com>2010-09-23 21:40:59 -0400
commit121bfe2c6a61630a4c03891824204e28ebdd235f (patch)
tree76bd390d2bd9e4614b2a0cd6e5bec1e258b25dda /pci-v2-1-4-resources-ensure-alignment-callback-doesn-t-allocate-below-available-start.patch
parent9e5584957c9cc106f9775d9fdc52a8d1300d749e (diff)
downloadkernel-121bfe2c6a61630a4c03891824204e28ebdd235f.tar.gz
kernel-121bfe2c6a61630a4c03891824204e28ebdd235f.tar.xz
kernel-121bfe2c6a61630a4c03891824204e28ebdd235f.zip
Add patches to fix problems with PCI _CRS
Diffstat (limited to 'pci-v2-1-4-resources-ensure-alignment-callback-doesn-t-allocate-below-available-start.patch')
-rw-r--r--pci-v2-1-4-resources-ensure-alignment-callback-doesn-t-allocate-below-available-start.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/pci-v2-1-4-resources-ensure-alignment-callback-doesn-t-allocate-below-available-start.patch b/pci-v2-1-4-resources-ensure-alignment-callback-doesn-t-allocate-below-available-start.patch
new file mode 100644
index 000000000..d1f4abad6
--- /dev/null
+++ b/pci-v2-1-4-resources-ensure-alignment-callback-doesn-t-allocate-below-available-start.patch
@@ -0,0 +1,28 @@
+diff --git a/kernel/resource.c b/kernel/resource.c
+index 7b36976..ace2269 100644
+--- a/kernel/resource.c
++++ b/kernel/resource.c
+@@ -371,6 +371,7 @@ static int find_resource(struct resource *root, struct resource *new,
+ {
+ struct resource *this = root->child;
+ struct resource tmp = *new;
++ resource_size_t start;
+
+ tmp.start = root->start;
+ /*
+@@ -391,8 +392,13 @@ static int find_resource(struct resource *root, struct resource *new,
+ if (tmp.end > max)
+ tmp.end = max;
+ tmp.start = ALIGN(tmp.start, align);
+- if (alignf)
+- tmp.start = alignf(alignf_data, &tmp, size, align);
++ if (alignf) {
++ start = alignf(alignf_data, &tmp, size, align);
++ if (tmp.start <= start && start <= tmp.end)
++ tmp.start = start;
++ else
++ tmp.start = tmp.end;
++ }
+ if (tmp.start < tmp.end && tmp.end - tmp.start >= size - 1) {
+ new->start = tmp.start;
+ new->end = tmp.start + size - 1;