mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
dma-mapping-fast: Fix sg-list length calculation in fast_smmu_unmap_sg()
The length of an IOVA mapped to an sg-list in fast_smmu_unmap_sg() is determined using the DMA length of the data in the sg-list. Using the DMA length of the entries in the sg-list may result in incorrectly calculating the length of the IOVA range that needs to be freed, as the buffers are mapped at an IOMMU granule. Thus, align the IOVA length to the IOMMU granule when unmapping IOVAs in fast_smmu_unmap_sg(). Change-Id: I7dbe88ed2db46b1c9b278f92c2a23a9ebc2d503a Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
parent
6ebd8dac2c
commit
962bad7d0a
1 changed files with 2 additions and 1 deletions
|
|
@ -378,7 +378,8 @@ static void fast_smmu_unmap_sg(struct device *dev,
|
|||
break;
|
||||
sg = tmp;
|
||||
}
|
||||
len = sg_dma_address(sg) + sg_dma_len(sg) - start;
|
||||
len = ALIGN(sg_dma_address(sg) + sg_dma_len(sg) - start,
|
||||
FAST_PAGE_SIZE);
|
||||
|
||||
av8l_fast_unmap_public(mapping->pgtbl_ops, start, len);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue