diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2010-12-16 12:38:31 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-12-17 13:00:49 -0500 |
commit | d14125ecfee05473de46f06d992db109308c57a3 (patch) | |
tree | 97bf6c8fb4b5320ddd4ae170afb11df6d26af8a8 /arch/x86 | |
parent | 5e52f1c5e85fdc3831eeae8b546577e94a586f81 (diff) |
Revert "x86/PCI: allocate space from the end of a region, not the beginning"
This reverts commit dc9887dc02e37bcf83f4e792aa14b07782ef54cf.
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/pci/i386.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index c4bb261c106e..8379c2c3d076 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -65,21 +65,16 @@ pcibios_align_resource(void *data, const struct resource *res, | |||
65 | resource_size_t size, resource_size_t align) | 65 | resource_size_t size, resource_size_t align) |
66 | { | 66 | { |
67 | struct pci_dev *dev = data; | 67 | struct pci_dev *dev = data; |
68 | resource_size_t start = round_down(res->end - size + 1, align); | 68 | resource_size_t start = res->start; |
69 | 69 | ||
70 | if (res->flags & IORESOURCE_IO) { | 70 | if (res->flags & IORESOURCE_IO) { |
71 | 71 | if (skip_isa_ioresource_align(dev)) | |
72 | /* | 72 | return start; |
73 | * If we're avoiding ISA aliases, the largest contiguous I/O | 73 | if (start & 0x300) |
74 | * port space is 256 bytes. Clearing bits 9 and 10 preserves | 74 | start = (start + 0x3ff) & ~0x3ff; |
75 | * all 256-byte and smaller alignments, so the result will | ||
76 | * still be correctly aligned. | ||
77 | */ | ||
78 | if (!skip_isa_ioresource_align(dev)) | ||
79 | start &= ~0x300; | ||
80 | } else if (res->flags & IORESOURCE_MEM) { | 75 | } else if (res->flags & IORESOURCE_MEM) { |
81 | if (start < BIOS_END) | 76 | if (start < BIOS_END) |
82 | start = res->end; /* fail; no space */ | 77 | start = BIOS_END; |
83 | } | 78 | } |
84 | return start; | 79 | return start; |
85 | } | 80 | } |