Hi Isaac, I had a go at removing the loop you have in pgsize_bitmap() over at:
https://lore.kernel.org/r/20210331030042.13348-4-isa...@codeaurora.org and I ended up with this. It's _very_ lightly tested, but I thought it might be useful to you, especially if you're going to be adding support for '->map_pages' as well. Cheers, Will Cc: "Isaac J. Manjarres" <isa...@codeaurora.org> Cc: Pratik Patel <prat...@codeaurora.org> Cc: Robin Murphy <robin.mur...@arm.com> Cc: Lu Baolu <baolu...@linux.intel.com> --->8 Isaac J. Manjarres (2): iommu/io-pgtable: Introduce unmap_pages() as a page table op iommu: Add an unmap_pages() op for IOMMU drivers Will Deacon (4): iommu: Use bitmap to calculate page size in iommu_pgsize() iommu: Split 'addr_merge' argument to iommu_pgsize() into separate parts iommu: Hook up '->unmap_pages' driver callback iommu: Accomodate larger pages in iommu_pgsize() 'count' calculation drivers/iommu/iommu.c | 87 +++++++++++++++++++++++++++----------- include/linux/io-pgtable.h | 4 ++ include/linux/iommu.h | 4 ++ 3 files changed, 70 insertions(+), 25 deletions(-) -- 2.31.0.291.g576ba9dcdaf-goog _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu