Selaa lähdekoodia

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 <[email protected]>
Himateja Reddy 2 vuotta sitten
vanhempi
sitoutus
6b8c6087fe
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      dsp/adsprpc.c

+ 2 - 2
dsp/adsprpc.c

@@ -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;