mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
staging: android: ion: fix partial sync for iommu
Fixes: 975372e2cb ("staging: android: ion: support partial cpu access")
Change-Id: Iabf3b04dbc838ca5c60fa1a0592bbb5aac496090
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
@@ -437,14 +437,11 @@ static int ion_sgl_sync_range(struct device *dev, struct scatterlist *sgl,
|
||||
for_each_sg(sgl, sg, nents, i) {
|
||||
unsigned int sg_offset, sg_left, size = 0;
|
||||
|
||||
if (i == 0)
|
||||
sg_dma_addr = sg_dma_address(sg);
|
||||
sg_dma_addr = sg_dma_address(sg);
|
||||
|
||||
len += sg->length;
|
||||
if (len <= offset) {
|
||||
sg_dma_addr += sg->length;
|
||||
if (len <= offset)
|
||||
continue;
|
||||
}
|
||||
|
||||
sg_left = len - offset;
|
||||
sg_offset = sg->length - sg_left;
|
||||
@@ -459,7 +456,6 @@ static int ion_sgl_sync_range(struct device *dev, struct scatterlist *sgl,
|
||||
|
||||
offset += size;
|
||||
length -= size;
|
||||
sg_dma_addr += sg->length;
|
||||
|
||||
if (length == 0)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user