]> Git Repo - linux.git/commitdiff
ARM: Fix DMA coherent allocator alignment
authorRussell King <[email protected]>
Wed, 3 Nov 2010 16:00:15 +0000 (16:00 +0000)
committerRussell King <[email protected]>
Sun, 7 Nov 2010 16:10:15 +0000 (16:10 +0000)
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: Petr Štetiar <[email protected]>
Signed-off-by: Russell King <[email protected]>
arch/arm/mm/dma-mapping.c

index e4dd0646e85978b89a164c40100d0561bd1005f7..ac6a36142fcd5a28084b3c669fac9e800fd65497 100644 (file)
@@ -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
         * smaller than a section from crossing a section boundary.
         */
-       bit = fls(size - 1) + 1;
+       bit = fls(size - 1);
        if (bit > SECTION_SHIFT)
                bit = SECTION_SHIFT;
        align = 1 << bit;
This page took 0.061552 seconds and 4 git commands to generate.