Skip to content

Commit 04c532a

Browse files
RalfGoebeljoergroedel
authored andcommitted
iommu/omap: Fix cache flushes on L2 table entries
The base address used for DMA operations on the second-level table did incorrectly include the offset for the table entry. The offset was then added again which lead to incorrect behavior. Operations on the L1 table are not affected. The calculation of the base address is changed to point to the beginning of the L2 table. Fixes: bfee0cf ("iommu/omap: Use DMA-API for performing cache flushes") Acked-by: Suman Anna <[email protected]> Signed-off-by: Ralf Goebel <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 1ffaddd commit 04c532a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iommu/omap-iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ static u32 *iopte_alloc(struct omap_iommu *obj, u32 *iopgd,
550550

551551
pte_ready:
552552
iopte = iopte_offset(iopgd, da);
553-
*pt_dma = virt_to_phys(iopte);
553+
*pt_dma = iopgd_page_paddr(iopgd);
554554
dev_vdbg(obj->dev,
555555
"%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n",
556556
__func__, da, iopgd, *iopgd, iopte, *iopte);
@@ -738,7 +738,7 @@ static size_t iopgtable_clear_entry_core(struct omap_iommu *obj, u32 da)
738738
}
739739
bytes *= nent;
740740
memset(iopte, 0, nent * sizeof(*iopte));
741-
pt_dma = virt_to_phys(iopte);
741+
pt_dma = iopgd_page_paddr(iopgd);
742742
flush_iopte_range(obj->dev, pt_dma, pt_offset, nent);
743743

744744
/*

0 commit comments

Comments
 (0)