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

Commit 38f66a4d authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Patrick Daly
Browse files

arm64: dma-mapping: use correct type for iova



IOMMU virtual addresses use the dma_addr_t type since they can be up to
64-bits.  We're currently using an `unsigned int' to store our IOVA in
arm_iommu_map_sg, which could result in truncation.  Use the correct
type for an I/O virtual address: dma_addr_t.

Change-Id: Ie63bf17268ca70d102ab9d472ed9bcc6f4a793d7
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent c262b511
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1659,7 +1659,8 @@ int arm_iommu_map_sg(struct device *dev, struct scatterlist *sg,
	struct scatterlist *s;
	int ret, i;
	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
	unsigned int iova, total_length = 0, current_offset = 0;
	unsigned int total_length = 0, current_offset = 0;
	dma_addr_t iova;
	int prot = __dma_direction_to_prot(dir);

	for_each_sg(sg, s, nents, i)