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

Commit 27174605 authored by Prakash Gupta's avatar Prakash Gupta Committed by Gerrit - the friendly Code Review server
Browse files

Revert "arm: dma-mapping: WARN_ON if iova is not 128M aligned"



This reverts commit 919aec60 ("arm: dma-mapping: WARN_ON if iova
is not 128M aligned")
This warning is unnecessary and is forcing the clients to use the 128M
aligned virtual address. This warning is introduced thinking that the
clients may unnecessarily lose the unaligned part in the VA higher
end.But that's okay as this is just a VA and at the maximum user can
lost the 128M - 1 bytes of VA. And the minimum VA is represented as
always 128M. All these calculations are around the 4K page size.

Change-Id: Id17c9a1894a6703eab0d4df370a064584ebe9c07
Signed-off-by: default avatarPrakash Gupta <guptap@codeaurora.org>
parent a91b82ae
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -2346,16 +2346,12 @@ static int
iommu_init_mapping(struct device *dev, struct dma_iommu_mapping *mapping)
{
	unsigned int bitmap_size = BITS_TO_LONGS(mapping->bits) * sizeof(long);
	u64 size = mapping->bits << PAGE_SHIFT;
	int extensions = 1;
	int err = -ENOMEM;

	if (!bitmap_size)
		return -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;