Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iommu/exynos: use page allocation function provided by iommu-pages.h

Convert iommu/exynos-iommu.c to use the new page allocation functions
provided in iommu-pages.h.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
Link: https://lore.kernel.org/r/20240413002522.1101315-7-pasha.tatashin@soleen.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>

authored by

Pasha Tatashin and committed by
Joerg Roedel
fe046f1b 4a0b77e7

+8 -6
+8 -6
drivers/iommu/exynos-iommu.c
··· 22 22 #include <linux/pm_runtime.h> 23 23 #include <linux/slab.h> 24 24 25 + #include "iommu-pages.h" 26 + 25 27 typedef u32 sysmmu_iova_t; 26 28 typedef u32 sysmmu_pte_t; 27 29 static struct iommu_domain exynos_identity_domain; ··· 902 900 if (!domain) 903 901 return NULL; 904 902 905 - domain->pgtable = (sysmmu_pte_t *)__get_free_pages(GFP_KERNEL, 2); 903 + domain->pgtable = iommu_alloc_pages(GFP_KERNEL, 2); 906 904 if (!domain->pgtable) 907 905 goto err_pgtable; 908 906 909 - domain->lv2entcnt = (short *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1); 907 + domain->lv2entcnt = iommu_alloc_pages(GFP_KERNEL, 1); 910 908 if (!domain->lv2entcnt) 911 909 goto err_counter; 912 910 ··· 932 930 return &domain->domain; 933 931 934 932 err_lv2ent: 935 - free_pages((unsigned long)domain->lv2entcnt, 1); 933 + iommu_free_pages(domain->lv2entcnt, 1); 936 934 err_counter: 937 - free_pages((unsigned long)domain->pgtable, 2); 935 + iommu_free_pages(domain->pgtable, 2); 938 936 err_pgtable: 939 937 kfree(domain); 940 938 return NULL; ··· 975 973 phys_to_virt(base)); 976 974 } 977 975 978 - free_pages((unsigned long)domain->pgtable, 2); 979 - free_pages((unsigned long)domain->lv2entcnt, 1); 976 + iommu_free_pages(domain->pgtable, 2); 977 + iommu_free_pages(domain->lv2entcnt, 1); 980 978 kfree(domain); 981 979 } 982 980