Skip to content

Commit 39f823d

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/tegra-smmu: Update to {map,unmap}_pages
Trivially update map/unmap to the new interface, which is quite happy for drivers to still process just one page per call. Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/338c520ed947d6d5b9d0509ccb4588908bd9ce1e.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent 8c63d1e commit 39f823d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/iommu/tegra-smmu.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,8 @@ __tegra_smmu_unmap(struct iommu_domain *domain, unsigned long iova,
764764
}
765765

766766
static int tegra_smmu_map(struct iommu_domain *domain, unsigned long iova,
767-
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
767+
phys_addr_t paddr, size_t size, size_t count,
768+
int prot, gfp_t gfp, size_t *mapped)
768769
{
769770
struct tegra_smmu_as *as = to_smmu_as(domain);
770771
unsigned long flags;
@@ -774,11 +775,14 @@ static int tegra_smmu_map(struct iommu_domain *domain, unsigned long iova,
774775
ret = __tegra_smmu_map(domain, iova, paddr, size, prot, gfp, &flags);
775776
spin_unlock_irqrestore(&as->lock, flags);
776777

778+
if (!ret)
779+
*mapped = size;
780+
777781
return ret;
778782
}
779783

780784
static size_t tegra_smmu_unmap(struct iommu_domain *domain, unsigned long iova,
781-
size_t size, struct iommu_iotlb_gather *gather)
785+
size_t size, size_t count, struct iommu_iotlb_gather *gather)
782786
{
783787
struct tegra_smmu_as *as = to_smmu_as(domain);
784788
unsigned long flags;
@@ -995,8 +999,8 @@ static const struct iommu_ops tegra_smmu_ops = {
995999
.pgsize_bitmap = SZ_4K,
9961000
.default_domain_ops = &(const struct iommu_domain_ops) {
9971001
.attach_dev = tegra_smmu_attach_dev,
998-
.map = tegra_smmu_map,
999-
.unmap = tegra_smmu_unmap,
1002+
.map_pages = tegra_smmu_map,
1003+
.unmap_pages = tegra_smmu_unmap,
10001004
.iova_to_phys = tegra_smmu_iova_to_phys,
10011005
.free = tegra_smmu_domain_free,
10021006
}

0 commit comments

Comments
 (0)