mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
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: b145c6e65e
("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>
This commit is contained in:
parent
49e4776100
commit
62b5e322fb
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ static int msm_iommu_pagetable_map(struct msm_mmu *mmu, u64 iova,
|
|||
u64 addr = iova;
|
||||
unsigned int i;
|
||||
|
||||
for_each_sg(sgt->sgl, sg, sgt->nents, i) {
|
||||
for_each_sgtable_sg(sgt, sg, i) {
|
||||
size_t size = sg->length;
|
||||
phys_addr_t phys = sg_phys(sg);
|
||||
|
||||
|
|
Loading…
Reference in a new issue