]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: dma-default: Fix 32-bit fall back to GFP_DMA
authorJames Hogan <james.hogan@imgtec.com>
Fri, 27 Mar 2015 08:33:43 +0000 (08:33 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 30 Sep 2015 14:27:39 +0000 (16:27 +0200)
commitd2e5b2219d8e71c2be656bfc43cb5af19d86b7c5
treecb02dc12f055cb377cefb98b982ec8f6ef9387e0
parent79c632dbd69a48e9725330b61de74d4f9badfb0b
MIPS: dma-default: Fix 32-bit fall back to GFP_DMA

If there is a DMA zone (usually 24bit = 16MB I believe), but no DMA32
zone, as is the case for some 32-bit kernels, then massage_gfp_flags()
will cause DMA memory allocated for devices with a 32..63-bit
coherent_dma_mask to fall back to using __GFP_DMA, even though there may
only be 32-bits of physical address available anyway.

Correct that case to compare against a mask the size of phys_addr_t
instead of always using a 64-bit mask.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Fixes: c0640b545889 ("MIPS: DMA: Fix computation of DMA flags from device's coherent_dma_mask.")
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 2.6.36+
Patchwork: https://patchwork.linux-mips.org/patch/9610/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mm/dma-default.c