aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2013-02-26 07:46:24 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-28 12:18:14 -0700
commit36bd37a9716002fc074b55638ff9583c03cea7ad (patch)
treeead4faae8532373e760aca9f50d511915097221e
parent608b6e6cb8a7a794df75b6b0a15e84317fdba136 (diff)
ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation
commit 9d1400cf79afb49584b4873eb22cd5130cb341db upstream. Atomic pool should always be allocated from DMA zone if such zone is available in the system to avoid issues caused by limited dma mask of any of the devices used for making an atomic allocation. Reported-by: Krzysztof Halasa <khc@pm.waw.pl> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/arm/mm/dma-mapping.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index dda3904dc64..5397da03e46 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -330,6 +330,7 @@ static int __init atomic_pool_init(void)
{
struct dma_pool *pool = &atomic_pool;
pgprot_t prot = pgprot_dmacoherent(pgprot_kernel);
+ gfp_t gfp = GFP_KERNEL | GFP_DMA;
unsigned long nr_pages = pool->size >> PAGE_SHIFT;
unsigned long *bitmap;
struct page *page;
@@ -348,8 +349,8 @@ static int __init atomic_pool_init(void)
if (IS_ENABLED(CONFIG_CMA))
ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page);
else
- ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot,
- &page, NULL);
+ ptr = __alloc_remap_buffer(NULL, pool->size, gfp, prot, &page,
+ NULL);
if (ptr) {
int i;