summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2017-06-28 10:46:03 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit9740909af0b109d072dbdd44c20643a2ab2a1ea7 (patch)
treeea2d242072430b68c18e6ff7633c56b5093063b8 /drivers/iommu
parent6db162a98012b749d5d928c3a94fe0d85076432b (diff)
MLK-15007-1 iommu: arm: pgtable: alloc pagetable in DMA area
Normally the iommu pagetable could be in 64bit address space, but we have one patch to address PCIE driver, 'commit 9e03e5076269 ("MLK-15064-2 ARM64: DMA: limit the dma mask to be 32bit")' The patch restrict swiotlb and iommu dma to be in 32bit address. So if we allocate pages in highmem, then dma_map_single will return a 32bit address. Then, we will get "Cannot accommodate DMA translation for IOMMU page tables", because `dma != virt_to_phys(pages)`. So we strict the lpae iommu pgtable in DMA area to fix this issue. Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/io-pgtable-arm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 7c9d632f1d09..76fb7d465cbd 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2014 ARM Limited
+ * Copyright 2017 NXP
*
* Author: Will Deacon <will.deacon@arm.com>
*/
@@ -212,7 +213,7 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,
{
struct device *dev = cfg->iommu_dev;
dma_addr_t dma;
- void *pages = alloc_pages_exact(size, gfp | __GFP_ZERO);
+ void *pages = alloc_pages_exact(size, gfp | __GFP_ZERO | __GFP_DMA);
if (!pages)
return NULL;