@@ -710,15 +710,32 @@ static size_t __arm_v7s_unmap(struct arm_v7s_io_pgtable *data,
710
710
return __arm_v7s_unmap (data , gather , iova , size , lvl + 1 , ptep );
711
711
}
712
712
713
- static size_t arm_v7s_unmap (struct io_pgtable_ops * ops , unsigned long iova ,
714
- size_t size , struct iommu_iotlb_gather * gather )
713
+ static size_t arm_v7s_unmap_pages (struct io_pgtable_ops * ops , unsigned long iova ,
714
+ size_t pgsize , size_t pgcount ,
715
+ struct iommu_iotlb_gather * gather )
715
716
{
716
717
struct arm_v7s_io_pgtable * data = io_pgtable_ops_to_data (ops );
718
+ size_t unmapped = 0 , ret ;
717
719
718
720
if (WARN_ON (iova >= (1ULL << data -> iop .cfg .ias )))
719
721
return 0 ;
720
722
721
- return __arm_v7s_unmap (data , gather , iova , size , 1 , data -> pgd );
723
+ while (pgcount -- ) {
724
+ ret = __arm_v7s_unmap (data , gather , iova , pgsize , 1 , data -> pgd );
725
+ if (!ret )
726
+ break ;
727
+
728
+ unmapped += pgsize ;
729
+ iova += pgsize ;
730
+ }
731
+
732
+ return unmapped ;
733
+ }
734
+
735
+ static size_t arm_v7s_unmap (struct io_pgtable_ops * ops , unsigned long iova ,
736
+ size_t size , struct iommu_iotlb_gather * gather )
737
+ {
738
+ return arm_v7s_unmap_pages (ops , iova , size , 1 , gather );
722
739
}
723
740
724
741
static phys_addr_t arm_v7s_iova_to_phys (struct io_pgtable_ops * ops ,
@@ -781,6 +798,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg,
781
798
data -> iop .ops = (struct io_pgtable_ops ) {
782
799
.map = arm_v7s_map ,
783
800
.unmap = arm_v7s_unmap ,
801
+ .unmap_pages = arm_v7s_unmap_pages ,
784
802
.iova_to_phys = arm_v7s_iova_to_phys ,
785
803
};
786
804
0 commit comments