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

Commit f11762c4 authored by Qingqing Zhou's avatar Qingqing Zhou
Browse files

arm: dma-mapping.c: Change the dma length in sg lists



Currently on 32-bit, the sg lists are virtually contiguous, but the dma
length of tail entries are not reorganized into zero, then error will
happen in ion_sgl_sync_range() which will check the sg lists and warn
if the dma length of tail entries is not zero.This warning is designed
for 64-bit. So change the 32-bit reorganization of sg lists like 64-bit.

Change-Id: I82e3832f8607df88ff832ece67d5dfa2791de51e
Signed-off-by: default avatarQingqing Zhou <qqzhou@codeaurora.org>
parent 7764f1a9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1950,7 +1950,10 @@ int arm_iommu_map_sg(struct device *dev, struct scatterlist *sg,

	for_each_sg(sg, s, nents, i) {
		s->dma_address = iova + current_offset;
		s->dma_length = total_length - current_offset;
		if (i == 0)
			s->dma_length = total_length;
		else
			s->dma_length = 0;
		current_offset += s->length;
	}