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

Commit ae4040d3 authored by Charan Teja Reddy's avatar Charan Teja Reddy
Browse files

arm: dma-mapping: add iova size alignment check



On 32bit systems, bitmap storing the iova information is stored in per
page and each page represents the 128MB of IOVA. So, for the
alloc_iova() to return the requested range, iova size should be aligned
to 128MB.

Change-Id: I66eb15cdbb3d6730cc4d84cad9f0c652f91278d6
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 26db1949
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2052,6 +2052,9 @@ arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size)
	if (!bitmap_size)
		return ERR_PTR(-EINVAL);

	WARN(!IS_ALIGNED(size, SZ_128M),
			"size is not aligned to 128M, alignment enforced");

	if (bitmap_size > PAGE_SIZE) {
		extensions = bitmap_size / PAGE_SIZE;
		bitmap_size = PAGE_SIZE;