msm: adsprpc: Add IOMMU_CACHE flag for iommy_map_sg

Currently memory shared to QRTR is not mapped with IOMMU_CACHE
flag. When using iommu_map_sg, IOMMU_CACHE flag makes the memory
coherent. Add IOMMU_CACHE flag to iommu_mag_sg to make memory
shared to QRTR coherent on APPS. Also remove DMA_ATTR_NO_KERNEL_MAPPING
attribute while allocating memory as it doesn't have significance when
the memory is coherent.

Signed-off-by: Himateja Reddy <quic_hmreddy@quicinc.com>
This commit is contained in:
Himateja Reddy
2023-01-23 12:56:14 -08:00
committed by Gerrit - the friendly Code Review server
parent e1f8f88b4b
commit 6b8c6087fe

View File

@@ -7440,7 +7440,7 @@ static int fastrpc_cb_probe(struct device *dev)
buf->virt = NULL;
buf->phys = 0;
buf->size = frpc_gen_addr_pool[1];
buf->dma_attr = DMA_ATTR_DELAYED_UNMAP | DMA_ATTR_NO_KERNEL_MAPPING;
buf->dma_attr = DMA_ATTR_DELAYED_UNMAP;
/* Allocate memory for adding to genpool */
buf->virt = dma_alloc_attrs(sess->smmu.dev, buf->size,
(dma_addr_t *)&buf->phys,
@@ -7465,7 +7465,7 @@ static int fastrpc_cb_probe(struct device *dev)
}
/* Map the allocated memory with fixed IOVA and is shared to remote subsystem */
err = iommu_map_sg(domain, frpc_gen_addr_pool[0], sgt.sgl,
sgt.nents, IOMMU_READ | IOMMU_WRITE);
sgt.nents, IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE);
if (err < 0) {
ADSPRPC_ERR("iommu_map_sg failed with err %d", err);
goto iommu_map_bail;