forked from Minki/linux
pci: fix PCI bus allocation alignment handling
In commit13583b1659
("PCI: refactor io size calculation code") Ram had a thinko in the refactorization of the code: the end result used the variable 'align' for the bus alignment, but the original code used 'min_align'. Since then, another use of that 'align' variable got introduced by commitc8adf9a3e8
("PCI: pre-allocate additional resources to devices only after successful allocation of essential resources.") Fix both of those uses to use 'min_align' as they should. Daniel Hellstrom <daniel@gaisler.com> Acked-by: Ram Pai <linuxram@us.ibm.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c44eaf41a5
commit
b42282e5a0
@ -676,10 +676,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
|
||||
min_align = align1 >> 1;
|
||||
align += aligns[order];
|
||||
}
|
||||
size0 = calculate_memsize(size, min_size, 0, resource_size(b_res), align);
|
||||
size0 = calculate_memsize(size, min_size, 0, resource_size(b_res), min_align);
|
||||
size1 = !add_size ? size :
|
||||
calculate_memsize(size, min_size+add_size, 0,
|
||||
resource_size(b_res), align);
|
||||
resource_size(b_res), min_align);
|
||||
if (!size0 && !size1) {
|
||||
if (b_res->start || b_res->end)
|
||||
dev_info(&bus->self->dev, "disabling bridge window "
|
||||
|
Loading…
Reference in New Issue
Block a user