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

Commit 7481e4c8 authored by Neeti Desai's avatar Neeti Desai
Browse files

msm: iommu: Correct the size passed to dmac_clean_range()



The size being passed to dmac_clean_range() inside
iommu_map_range is incorrect; instead of providing the
total length of all the chunks in the chunk list, we're
currently passing the length of just one chunk. Fix this
to pass in the right length.

Change-Id: Id9f4ce9be8a21da0e037da987b3e1fbd8d81dd2f
Signed-off-by: default avatarNeeti Desai <neetid@codeaurora.org>
parent 51c75088
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -567,7 +567,7 @@ static int msm_iommu_sec_ptbl_map_range(struct msm_iommu_drvdata *iommu_drvdata,
	struct msm_scm_map2_req map;
	unsigned int *pa_list = 0;
	unsigned int pa, cnt;
	void *flush_va;
	void *flush_va, *flush_va_end;
	unsigned int offset = 0, chunk_offset = 0;
	int ret;

@@ -639,7 +639,9 @@ static int msm_iommu_sec_ptbl_map_range(struct msm_iommu_drvdata *iommu_drvdata,
	/*
	 * Ensure that the buffer is in RAM by the time it gets to TZ
	 */
	dmac_clean_range(flush_va, flush_va + map.plist.list_size);
	flush_va_end = (void *) (((unsigned long) flush_va) +
			(map.plist.list_size * sizeof(*pa_list)));
	dmac_clean_range(flush_va, flush_va_end);

	ret = msm_iommu_sec_map2(&map);
	kfree(pa_list);