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

Commit bc13d86d authored by Liam Mark's avatar Liam Mark
Browse files

arm: dma-mapping: handle IOVA address zero



The IOVA allocator used by these calls supports IOVA address
zero so properly handle IOVA address zero.

Change-Id: I012452d4cf3534dfb79e6deb15b7ff74f5e3bb40
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
parent b979f780
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -1931,9 +1931,6 @@ static void arm_coherent_iommu_unmap_page(struct device *dev, dma_addr_t handle,
	int offset = handle & ~PAGE_MASK;
	int len = PAGE_ALIGN(size + offset);

	if (!iova)
		return;

	iommu_unmap(mapping->domain, iova, len);
	__free_iova(mapping, iova, len);
}
@@ -1957,9 +1954,6 @@ static void arm_iommu_unmap_page(struct device *dev, dma_addr_t handle,
	int offset = handle & ~PAGE_MASK;
	int len = PAGE_ALIGN(size + offset);

	if (!iova)
		return;

	if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
		__dma_page_dev_to_cpu(page, offset, size, dir);

@@ -1975,9 +1969,6 @@ static void arm_iommu_sync_single_for_cpu(struct device *dev,
	struct page *page = phys_to_page(iommu_iova_to_phys(mapping->domain, iova));
	unsigned int offset = handle & ~PAGE_MASK;

	if (!iova)
		return;

	__dma_page_dev_to_cpu(page, offset, size, dir);
}

@@ -1989,9 +1980,6 @@ static void arm_iommu_sync_single_for_device(struct device *dev,
	struct page *page = phys_to_page(iommu_iova_to_phys(mapping->domain, iova));
	unsigned int offset = handle & ~PAGE_MASK;

	if (!iova)
		return;

	__dma_page_cpu_to_dev(page, offset, size, dir);
}

+0 −9
Original line number Diff line number Diff line
@@ -1796,9 +1796,6 @@ static void arm_iommu_unmap_page(struct device *dev, dma_addr_t handle,
	int offset = handle & ~PAGE_MASK;
	int len = PAGE_ALIGN(size + offset);

	if (!iova)
		return;

	if (!(is_device_dma_coherent(dev) ||
	      dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)))
		__dma_page_dev_to_cpu(page, offset, size, dir);
@@ -1816,9 +1813,6 @@ static void arm_iommu_sync_single_for_cpu(struct device *dev,
						mapping->domain, iova));
	unsigned int offset = handle & ~PAGE_MASK;

	if (!iova)
		return;

	if (!is_device_dma_coherent(dev))
		__dma_page_dev_to_cpu(page, offset, size, dir);
}
@@ -1832,9 +1826,6 @@ static void arm_iommu_sync_single_for_device(struct device *dev,
						mapping->domain, iova));
	unsigned int offset = handle & ~PAGE_MASK;

	if (!iova)
		return;

	if (!is_device_dma_coherent(dev))
		__dma_page_cpu_to_dev(page, offset, size, dir);
}