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

Commit 8d70f4d8 authored by Michael Adisumarta's avatar Michael Adisumarta
Browse files

msm: ipa: fix to match MHI Prime ring allocation size with dma api



This fix ensures to match the MHI Prime ring allocation sizes with
dma mapping/unmapping apis failing which may cause missed page table
mapping while invalidating the cache lines.

Change-Id: I6d2a70980a106036e046b135010a5c3d22c57fcb
Acked-by: default avatarJyothi J <jyothij@qti.qualcom.com>
Signed-off-by: default avatarMichael Adisumarta <madisuma@codeaurora.org>
parent 6298b5f1
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ static dma_addr_t ipa_mpm_smmu_map(void *va_addr,

		/* Flush the cache with dma_map_single for IPA AP CB */
		*ap_cb_iova = dma_map_single(ipa3_ctx->pdev, va_addr,
						sz, dir);
						IPA_MPM_RING_TOTAL_SIZE, dir);
		ret = ipa3_iommu_map(ipa_smmu_domain, iova_p,
					pa_p, size_p, prot);
		if (ret) {
@@ -499,7 +499,8 @@ static dma_addr_t ipa_mpm_smmu_map(void *va_addr,
		iova = iova_p;
		cb->next_addr = iova_p + size_p;
	} else {
		iova = dma_map_single(ipa3_ctx->pdev, va_addr, sz, dir);
		iova = dma_map_single(ipa3_ctx->pdev, va_addr,
					IPA_MPM_RING_TOTAL_SIZE, dir);
		*ap_cb_iova = iova;
	}
	return iova;
@@ -556,9 +557,10 @@ static void ipa_mpm_smmu_unmap(dma_addr_t carved_iova, int sz, int dir,

		cb->next_addr -= size_p;
		dma_unmap_single(ipa3_ctx->pdev, ap_cb_iova,
			size_p, dir);
			IPA_MPM_RING_TOTAL_SIZE, dir);
	} else {
		dma_unmap_single(ipa3_ctx->pdev, ap_cb_iova, sz, dir);
		dma_unmap_single(ipa3_ctx->pdev, ap_cb_iova,
			IPA_MPM_RING_TOTAL_SIZE, dir);
	}
}