Loading drivers/platform/msm/ipa/ipa_api.c +1 −1 Original line number Diff line number Diff line Loading @@ -381,7 +381,7 @@ int ipa_smmu_store_sgt(struct sg_table **out_ch_ptr, } memcpy((*out_ch_ptr)->sgl, in_sgt_ptr->sgl, nents*sizeof((*out_ch_ptr)->sgl)); nents*sizeof(struct scatterlist)); (*out_ch_ptr)->nents = nents; (*out_ch_ptr)->orig_nents = in_sgt_ptr->orig_nents; } Loading drivers/platform/msm/ipa/ipa_v3/ipa_client.c +27 −8 Original line number Diff line number Diff line Loading @@ -432,17 +432,36 @@ int ipa3_smmu_map_peer_buff(u64 iova, u32 size, bool map, struct sg_table *sgt, return -EINVAL; } } } else { if (sgt != NULL) { va = rounddown(iova, PAGE_SIZE); len = 0; for_each_sg(sgt->sgl, sg, sgt->nents, i) { len = PAGE_ALIGN(sg->offset + sg->length); res = iommu_unmap(smmu_domain, va, roundup(len, PAGE_SIZE)); if (res != roundup(len, PAGE_SIZE)) { IPAERR("Fail to unmap iova=%llx\n", iova); return -EINVAL; } va += len; count++; } } else { res = iommu_unmap(smmu_domain, rounddown(iova, PAGE_SIZE), roundup(size + iova - rounddown(iova, PAGE_SIZE), roundup(size + iova - rounddown(iova, PAGE_SIZE), PAGE_SIZE)); if (res != roundup(size + iova - rounddown(iova, PAGE_SIZE), PAGE_SIZE)) { if (res != roundup(size + iova - rounddown(iova, PAGE_SIZE), PAGE_SIZE)) { IPAERR("Fail to unmap 0x%llx\n", iova); return -EINVAL; } } } IPADBG("Peer buff %s 0x%llx\n", map ? "map" : "unmap", iova); return 0; } Loading Loading
drivers/platform/msm/ipa/ipa_api.c +1 −1 Original line number Diff line number Diff line Loading @@ -381,7 +381,7 @@ int ipa_smmu_store_sgt(struct sg_table **out_ch_ptr, } memcpy((*out_ch_ptr)->sgl, in_sgt_ptr->sgl, nents*sizeof((*out_ch_ptr)->sgl)); nents*sizeof(struct scatterlist)); (*out_ch_ptr)->nents = nents; (*out_ch_ptr)->orig_nents = in_sgt_ptr->orig_nents; } Loading
drivers/platform/msm/ipa/ipa_v3/ipa_client.c +27 −8 Original line number Diff line number Diff line Loading @@ -432,17 +432,36 @@ int ipa3_smmu_map_peer_buff(u64 iova, u32 size, bool map, struct sg_table *sgt, return -EINVAL; } } } else { if (sgt != NULL) { va = rounddown(iova, PAGE_SIZE); len = 0; for_each_sg(sgt->sgl, sg, sgt->nents, i) { len = PAGE_ALIGN(sg->offset + sg->length); res = iommu_unmap(smmu_domain, va, roundup(len, PAGE_SIZE)); if (res != roundup(len, PAGE_SIZE)) { IPAERR("Fail to unmap iova=%llx\n", iova); return -EINVAL; } va += len; count++; } } else { res = iommu_unmap(smmu_domain, rounddown(iova, PAGE_SIZE), roundup(size + iova - rounddown(iova, PAGE_SIZE), roundup(size + iova - rounddown(iova, PAGE_SIZE), PAGE_SIZE)); if (res != roundup(size + iova - rounddown(iova, PAGE_SIZE), PAGE_SIZE)) { if (res != roundup(size + iova - rounddown(iova, PAGE_SIZE), PAGE_SIZE)) { IPAERR("Fail to unmap 0x%llx\n", iova); return -EINVAL; } } } IPADBG("Peer buff %s 0x%llx\n", map ? "map" : "unmap", iova); return 0; } Loading