arm/arm64: dma-mapping: Fix iova region size

Clients may have additional mappings in an iommu domain which are not
managed by arm_iommu_create_mapping. As such, it is important that
arm_iommu_create_mapping only use the iova region specified by the client.
However, the current implementation rounds the size of the region up to a
256K boundary (on arm64).

Change-Id: I88ddd98a76b39e3e9126d78da8e725491f2a5b32
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
This commit is contained in:
Patrick Daly 2016-08-02 14:02:49 -07:00
parent e94b446eac
commit 2d221c0799
2 changed files with 2 additions and 2 deletions

View file

@ -2078,7 +2078,7 @@ arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size)
mapping->nr_bitmaps = 1;
mapping->extensions = extensions;
mapping->base = base;
mapping->bits = BITS_PER_BYTE * bitmap_size;
mapping->bits = bits;
spin_lock_init(&mapping->lock);

View file

@ -2064,7 +2064,7 @@ arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size)
goto err2;
mapping->base = base;
mapping->bits = BITS_PER_BYTE * bitmap_size;
mapping->bits = bits;
spin_lock_init(&mapping->lock);
mapping->domain = iommu_domain_alloc(bus);