diff options
Diffstat (limited to 'drivers/iommu/dma-mapping-fast.c')
-rw-r--r-- | drivers/iommu/dma-mapping-fast.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/iommu/dma-mapping-fast.c b/drivers/iommu/dma-mapping-fast.c index 004f34ecbff8..df5140d23015 100644 --- a/drivers/iommu/dma-mapping-fast.c +++ b/drivers/iommu/dma-mapping-fast.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -17,7 +17,8 @@ #include <linux/vmalloc.h> #include <asm/cacheflush.h> #include <asm/dma-iommu.h> - +#include <linux/slab.h> +#include <linux/vmalloc.h> /* some redundant definitions... :( TODO: move to io-pgtable-fast.h */ #define FAST_PAGE_SHIFT 12 @@ -632,7 +633,7 @@ static void __fast_smmu_mapped_over_stale(struct dma_fast_smmu_mapping *fast, dev_err(fast->dev, "Mapped over stale tlb at %pa\n", &iova); dev_err(fast->dev, "bitmap (failure at idx %lu):\n", bitmap_idx); dev_err(fast->dev, "ptep: %p pmds: %p diff: %lu\n", ptep, - fast->pgtbl_pmds, ptep - fast->pgtbl_pmds); + fast->pgtbl_pmds, bitmap_idx); print_hex_dump(KERN_ERR, "bmap: ", DUMP_PREFIX_ADDRESS, 32, 8, fast->bitmap, fast->bitmap_size, false); } @@ -682,7 +683,7 @@ static const struct dma_map_ops fast_smmu_dma_ops = { * fast_smmu_attach_device function. */ static struct dma_fast_smmu_mapping *__fast_smmu_create_mapping_sized( - dma_addr_t base, size_t size) + dma_addr_t base, u64 size) { struct dma_fast_smmu_mapping *fast; @@ -725,7 +726,7 @@ int fast_smmu_attach_device(struct device *dev, int atomic_domain = 1; struct iommu_domain *domain = mapping->domain; struct iommu_pgtbl_info info; - size_t size = mapping->bits << PAGE_SHIFT; + u64 size = (u64)mapping->bits << PAGE_SHIFT; if (mapping->base + size > (SZ_1G * 4ULL)) return -EINVAL; |