Skip to content

Commit 62b5e32

Browse files
fltorobclark
authored andcommitted
drm/msm: use for_each_sgtable_sg to iterate over scatterlist
The dma_map_sgtable() call (used to invalidate cache) overwrites sgt->nents with 1, so msm_iommu_pagetable_map maps only the first physical segment. To fix this problem use for_each_sgtable_sg(), which uses orig_nents. Fixes: b145c6e ("drm/msm: Add support to create a local pagetable") Signed-off-by: Jonathan Marek <jonathan@marek.ca> Link: https://lore.kernel.org/r/20220613221019.11399-1-jonathan@marek.ca Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 49e4776 commit 62b5e32

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/msm/msm_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int msm_iommu_pagetable_map(struct msm_mmu *mmu, u64 iova,
5858
u64 addr = iova;
5959
unsigned int i;
6060

61-
for_each_sg(sgt->sgl, sg, sgt->nents, i) {
61+
for_each_sgtable_sg(sgt, sg, i) {
6262
size_t size = sg->length;
6363
phys_addr_t phys = sg_phys(sg);
6464

0 commit comments

Comments
 (0)