diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-04 04:33:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-04 04:33:59 -0400 |
commit | 5f17cfce5776c566d64430f543a289e5cfa4538b (patch) | |
tree | f5da29c42ce3b29a35791d9192fbcbe0fb737f30 /drivers/pci | |
parent | de014d617636d6a6bd5aef3b3d1f7f9a35669057 (diff) |
PCI: fix pbus_size_mem() resource alignment for CardBus controllers
Commit 884525655d07fdee9245716b998ecdc45cdd8007 ("PCI: clean up resource
alignment management") changed the resource handling to mark how a
resource was aligned on a per-resource basis.
Thus, instead of looking at the resource number to determine whether it
was a bridge resource or a regular resource (they have different
alignment rules), we should just ask the resource for its alignment
directly.
The reason this broke only cardbus resources was that for the other
types of resources, the old way of deciding alignment actually still
happened to work. But CardBus bridge resources had been changed by
commit 934b7024f0ed29003c95cef447d92737ab86dc4f ("Fix cardbus resource
allocation") to look more like regular resources than PCI bridge
resources from an alignment handling standpoint.
Reported-and-tested-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/setup-bus.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 82634a2f1b1d..1aad599816f7 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -352,11 +352,12 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long | |||
352 | continue; | 352 | continue; |
353 | r_size = r->end - r->start + 1; | 353 | r_size = r->end - r->start + 1; |
354 | /* For bridges size != alignment */ | 354 | /* For bridges size != alignment */ |
355 | align = (i < PCI_BRIDGE_RESOURCES) ? r_size : r->start; | 355 | align = resource_alignment(r); |
356 | order = __ffs(align) - 20; | 356 | order = __ffs(align) - 20; |
357 | if (order > 11) { | 357 | if (order > 11) { |
358 | dev_warn(&dev->dev, "BAR %d too large: " | 358 | dev_warn(&dev->dev, "BAR %d bad alignment %llx: " |
359 | "%#016llx-%#016llx\n", i, | 359 | "%#016llx-%#016llx\n", i, |
360 | (unsigned long long)align, | ||
360 | (unsigned long long)r->start, | 361 | (unsigned long long)r->start, |
361 | (unsigned long long)r->end); | 362 | (unsigned long long)r->end); |
362 | r->flags = 0; | 363 | r->flags = 0; |