Commit d14125ec authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes

Revert "x86/PCI: allocate space from the end of a region, not the beginning"

This reverts commit dc9887dc.
Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 5e52f1c5
...@@ -65,21 +65,16 @@ pcibios_align_resource(void *data, const struct resource *res, ...@@ -65,21 +65,16 @@ pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
resource_size_t start = round_down(res->end - size + 1, align); resource_size_t start = res->start;
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
if (skip_isa_ioresource_align(dev))
/* return start;
* If we're avoiding ISA aliases, the largest contiguous I/O if (start & 0x300)
* port space is 256 bytes. Clearing bits 9 and 10 preserves start = (start + 0x3ff) & ~0x3ff;
* all 256-byte and smaller alignments, so the result will
* still be correctly aligned.
*/
if (!skip_isa_ioresource_align(dev))
start &= ~0x300;
} else if (res->flags & IORESOURCE_MEM) { } else if (res->flags & IORESOURCE_MEM) {
if (start < BIOS_END) if (start < BIOS_END)
start = res->end; /* fail; no space */ start = BIOS_END;
} }
return start; return start;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment