From: Russell King Date: Wed, 3 Nov 2010 16:00:15 +0000 (+0000) Subject: ARM: Fix DMA coherent allocator alignment X-Git-Tag: v5.15~27470^2~10 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=c947f69fff183e5d2a06160d9262b5dab7359e95;p=mirror_ubuntu-kernels.git 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: Petr Štetiar Signed-off-by: Russell King --- diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index e4dd0646e859..ac6a36142fcd 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -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;