diff options
author | Hiroshi Doyu <hdoyu@nvidia.com> | 2013-12-10 13:23:55 +0200 |
---|---|---|
committer | Krishna Reddy <vdumpa@nvidia.com> | 2013-12-12 11:55:38 -0800 |
commit | 595718f950ad1e7a98917d1e944c7c154a308ea2 (patch) | |
tree | df34e4339d39ec01d37f4fb3f272e7529d3685b8 /arch/arm/mm | |
parent | bac9b5361458856c53c2636ee0c47f57f41a19c2 (diff) |
ARM: dma-mapping: alloc highmem w/o GFP_DMA*
There's a case that a client wants to avoid highmem explicitly. For
example some PM code lets firmware access to pages during
suspend/resume when IOMMU is off. This allows a client to specify a
type of pages{GPF_DMA,GFP_DMA32} to not contradicting to
GFP_HIGHMEM. This would be valid if AArch64 selects ZONE_DMA(32).
Bug 1414172
Change-Id: I3c97262f9388094dae12a350420a3d184d1e7144
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/343645
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Tested-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 983488edb35f..98db3fa8b86e 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1459,9 +1459,12 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, /* * IOMMU can map any pages, so himem can also be used here + * unless some DMA'able area is explicitly required. */ - gfp |= __GFP_NOWARN | __GFP_HIGHMEM; + if (!(gfp & GFP_DMA) && !(gfp & GFP_DMA32)) + gfp |= __GFP_HIGHMEM; + gfp |= __GFP_NOWARN; while (count) { int j, order = __fls(count); |