Эх сурвалжийг харах

msm: camera: memmgr: Use orig_nents while calling iommu_map_sg

Use orign_nents instead of nents while calling iommu_map_sg.
nents is not compatible with dma buf heaps.
orig_nents works with both ion and dma buf heaps.

CRs-Fixed: 2852327
Change-Id: Id1474cb2306f2df8b87797d1ba55bc6a6b1d0f54
Signed-off-by: Pavan Kumar Chilamkurthi <[email protected]>
Pavan Kumar Chilamkurthi 4 жил өмнө
parent
commit
bbcd004721

+ 5 - 3
drivers/cam_smmu/cam_smmu_api.c

@@ -1909,10 +1909,12 @@ int cam_smmu_reserve_sec_heap(int32_t smmu_hdl,
 	size = iommu_map_sg(iommu_cb_set.cb_info[idx].domain,
 		sec_heap_iova,
 		secheap_buf->table->sgl,
-		secheap_buf->table->nents,
+		secheap_buf->table->orig_nents,
 		prot);
 	if (size != sec_heap_iova_len) {
-		CAM_ERR(CAM_SMMU, "IOMMU mapping failed");
+		CAM_ERR(CAM_SMMU,
+			"IOMMU mapping failed size=%zu, sec_heap_iova_len=%zu",
+			size, sec_heap_iova_len);
 		goto err_unmap_sg;
 	}
 
@@ -2058,7 +2060,7 @@ static int cam_smmu_map_buffer_validate(struct dma_buf *buf,
 		if (iommu_cb_set.force_cache_allocs)
 			prot |= IOMMU_CACHE;
 
-		size = iommu_map_sg(domain, iova, table->sgl, table->nents,
+		size = iommu_map_sg(domain, iova, table->sgl, table->orig_nents,
 				prot);
 
 		if (size < 0) {