Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d221c07 authored by Patrick Daly's avatar Patrick Daly
Browse files

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: default avatarPatrick Daly <pdaly@codeaurora.org>
parent e94b446e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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);