Re: [PATCH] iommu/pages: Fix iommu_pages_flush_incoherent() for non-x86
From: Jason Gunthorpe
Date: Fri Apr 24 2026 - 09:07:29 EST
On Fri, Apr 24, 2026 at 11:50:51AM +0000, Mostafa Saleh wrote:
> The dma_sync_single_for_device() function expects a dma_addr_t, but
> iommu_pages_flush_incoherent() was incorrectly passing a virtual
> address.
>
> Since iommu_pages_start_incoherent() enforces a 1:1 mapping between
> DMA addresses and physical addresses (checked via WARN_ON), we can
> convert the virtual address to a physical address before passing it to
> the DMA API.
>
> This also matches the behaviour of the other non-x86 in
> iommu_pages_free_incoherent(), which uses virt_to_phys(virt);
>
> Fixes: 36ae67b13976 ("iommu/pages: Add support for incoherent IOMMU page table walkers")
> Signed-off-by: Mostafa Saleh <smostafa@xxxxxxxxxx>
> ---
> drivers/iommu/iommu-pages.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
Jason