@@ -564,8 +564,7 @@ static int arm_v7s_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
564
564
565
565
iova += pgsize ;
566
566
paddr += pgsize ;
567
- if (mapped )
568
- * mapped += pgsize ;
567
+ * mapped += pgsize ;
569
568
}
570
569
/*
571
570
* Synchronise all PTE updates for the new mapping before there's
@@ -576,12 +575,6 @@ static int arm_v7s_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
576
575
return ret ;
577
576
}
578
577
579
- static int arm_v7s_map (struct io_pgtable_ops * ops , unsigned long iova ,
580
- phys_addr_t paddr , size_t size , int prot , gfp_t gfp )
581
- {
582
- return arm_v7s_map_pages (ops , iova , paddr , size , 1 , prot , gfp , NULL );
583
- }
584
-
585
578
static void arm_v7s_free_pgtable (struct io_pgtable * iop )
586
579
{
587
580
struct arm_v7s_io_pgtable * data = io_pgtable_to_data (iop );
@@ -764,12 +757,6 @@ static size_t arm_v7s_unmap_pages(struct io_pgtable_ops *ops, unsigned long iova
764
757
return unmapped ;
765
758
}
766
759
767
- static size_t arm_v7s_unmap (struct io_pgtable_ops * ops , unsigned long iova ,
768
- size_t size , struct iommu_iotlb_gather * gather )
769
- {
770
- return arm_v7s_unmap_pages (ops , iova , size , 1 , gather );
771
- }
772
-
773
760
static phys_addr_t arm_v7s_iova_to_phys (struct io_pgtable_ops * ops ,
774
761
unsigned long iova )
775
762
{
@@ -842,9 +829,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg,
842
829
goto out_free_data ;
843
830
844
831
data -> iop .ops = (struct io_pgtable_ops ) {
845
- .map = arm_v7s_map ,
846
832
.map_pages = arm_v7s_map_pages ,
847
- .unmap = arm_v7s_unmap ,
848
833
.unmap_pages = arm_v7s_unmap_pages ,
849
834
.iova_to_phys = arm_v7s_iova_to_phys ,
850
835
};
@@ -954,6 +939,7 @@ static int __init arm_v7s_do_selftests(void)
954
939
};
955
940
unsigned int iova , size , iova_start ;
956
941
unsigned int i , loopnr = 0 ;
942
+ size_t mapped ;
957
943
958
944
selftest_running = true;
959
945
@@ -984,15 +970,16 @@ static int __init arm_v7s_do_selftests(void)
984
970
iova = 0 ;
985
971
for_each_set_bit (i , & cfg .pgsize_bitmap , BITS_PER_LONG ) {
986
972
size = 1UL << i ;
987
- if (ops -> map (ops , iova , iova , size , IOMMU_READ |
988
- IOMMU_WRITE |
989
- IOMMU_NOEXEC |
990
- IOMMU_CACHE , GFP_KERNEL ))
973
+ if (ops -> map_pages (ops , iova , iova , size , 1 ,
974
+ IOMMU_READ | IOMMU_WRITE |
975
+ IOMMU_NOEXEC | IOMMU_CACHE ,
976
+ GFP_KERNEL , & mapped ))
991
977
return __FAIL (ops );
992
978
993
979
/* Overlapping mappings */
994
- if (!ops -> map (ops , iova , iova + size , size ,
995
- IOMMU_READ | IOMMU_NOEXEC , GFP_KERNEL ))
980
+ if (!ops -> map_pages (ops , iova , iova + size , size , 1 ,
981
+ IOMMU_READ | IOMMU_NOEXEC , GFP_KERNEL ,
982
+ & mapped ))
996
983
return __FAIL (ops );
997
984
998
985
if (ops -> iova_to_phys (ops , iova + 42 ) != (iova + 42 ))
@@ -1007,11 +994,12 @@ static int __init arm_v7s_do_selftests(void)
1007
994
size = 1UL << __ffs (cfg .pgsize_bitmap );
1008
995
while (i < loopnr ) {
1009
996
iova_start = i * SZ_16M ;
1010
- if (ops -> unmap (ops , iova_start + size , size , NULL ) != size )
997
+ if (ops -> unmap_pages (ops , iova_start + size , size , 1 , NULL ) != size )
1011
998
return __FAIL (ops );
1012
999
1013
1000
/* Remap of partial unmap */
1014
- if (ops -> map (ops , iova_start + size , size , size , IOMMU_READ , GFP_KERNEL ))
1001
+ if (ops -> map_pages (ops , iova_start + size , size , size , 1 ,
1002
+ IOMMU_READ , GFP_KERNEL , & mapped ))
1015
1003
return __FAIL (ops );
1016
1004
1017
1005
if (ops -> iova_to_phys (ops , iova_start + size + 42 )
@@ -1025,14 +1013,15 @@ static int __init arm_v7s_do_selftests(void)
1025
1013
for_each_set_bit (i , & cfg .pgsize_bitmap , BITS_PER_LONG ) {
1026
1014
size = 1UL << i ;
1027
1015
1028
- if (ops -> unmap (ops , iova , size , NULL ) != size )
1016
+ if (ops -> unmap_pages (ops , iova , size , 1 , NULL ) != size )
1029
1017
return __FAIL (ops );
1030
1018
1031
1019
if (ops -> iova_to_phys (ops , iova + 42 ))
1032
1020
return __FAIL (ops );
1033
1021
1034
1022
/* Remap full block */
1035
- if (ops -> map (ops , iova , iova , size , IOMMU_WRITE , GFP_KERNEL ))
1023
+ if (ops -> map_pages (ops , iova , iova , size , 1 , IOMMU_WRITE ,
1024
+ GFP_KERNEL , & mapped ))
1036
1025
return __FAIL (ops );
1037
1026
1038
1027
if (ops -> iova_to_phys (ops , iova + 42 ) != (iova + 42 ))
0 commit comments