[PATCH 2/3] iommu/io-pgtable-arm: Rework to use the iommu-pages API
Jason Gunthorpe
jgg at ziepe.ca
Fri May 15 06:54:28 PDT 2026
On Wed, May 13, 2026 at 09:52:02PM +0000, Mostafa Saleh wrote:
> Update the io-pgtable-arm allocator to use the iommu-pages API.
>
> Replace the DMA API usage from __arm_lpae_alloc_pages() with
> iommu_pages_start_incoherent() and from __arm_lpae_free_pages() with
> iommu_pages_free_incoherent().
>
> Since the iommu-pages API relies on metadata stored in the struct page
> during iommu_alloc_pages_node_sz(), it cannot be used safely with memory
> allocated via the custom cfg->alloc (which may not be backed by pages).
> So, isolate that logic and keep it as it.
>
> Suggested-by: Jason Gunthorpe <jgg at ziepe.ca>
> Signed-off-by: Mostafa Saleh <smostafa at google.com>
> ---
> drivers/iommu/io-pgtable-arm.c | 79 ++++++++++++++++++++++++----------
> 1 file changed, 56 insertions(+), 23 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>
I feel the setup for incoherent walk for panthor is kind of sketchy,
if you select incoherent walk and pass in a random GPU driver struct
device there are alot of assumptions suddenly to know the dma API is
doing the right thing..
Jason
More information about the linux-arm-kernel
mailing list