Commit c947f69f authored by Russell King's avatar Russell King

ARM: Fix DMA coherent allocator alignment

An out by one bug meant that the DMA coherent allocator was aligning
to one more bit than it should, causing it to run out of available
memory quicker.  Fix this.
Reported-by: default avatarPetr Štetiar <ynezz@true.cz>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 151f52f0
...@@ -198,7 +198,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot) ...@@ -198,7 +198,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot)
* fragmentation of the DMA space, and also prevents allocations * fragmentation of the DMA space, and also prevents allocations
* smaller than a section from crossing a section boundary. * smaller than a section from crossing a section boundary.
*/ */
bit = fls(size - 1) + 1; bit = fls(size - 1);
if (bit > SECTION_SHIFT) if (bit > SECTION_SHIFT)
bit = SECTION_SHIFT; bit = SECTION_SHIFT;
align = 1 << bit; align = 1 << bit;
......
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