linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: joro@8bytes.org, will@kernel.org
Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	m.szyprowski@samsung.com, heiko@sntech.de,
	jernej.skrabec@gmail.com, thierry.reding@gmail.com,
	vdumpa@nvidia.com
Subject: [PATCH 2/8] iommu/omap: Update to {map,unmap}_pages
Date: Tue, 12 Sep 2023 17:18:38 +0100	[thread overview]
Message-ID: <7bad94ffccd4cba32bded72e0860974012881e24.1694525662.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1694525662.git.robin.murphy@arm.com>

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 <robin.murphy@arm.com>
---
 drivers/iommu/omap-iommu.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 537e402f9bba..9e07dc94af76 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1318,7 +1318,8 @@ static u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa, int pgsz)
 }
 
 static int omap_iommu_map(struct iommu_domain *domain, unsigned long da,
-			  phys_addr_t pa, size_t bytes, int prot, gfp_t gfp)
+			  phys_addr_t pa, size_t bytes, size_t count,
+			  int prot, gfp_t gfp, size_t *mapped)
 {
 	struct omap_iommu_domain *omap_domain = to_omap_domain(domain);
 	struct device *dev = omap_domain->dev;
@@ -1356,13 +1357,15 @@ static int omap_iommu_map(struct iommu_domain *domain, unsigned long da,
 			oiommu = iommu->iommu_dev;
 			iopgtable_clear_entry(oiommu, da);
 		}
+	} else {
+		*mapped = bytes;
 	}
 
 	return ret;
 }
 
 static size_t omap_iommu_unmap(struct iommu_domain *domain, unsigned long da,
-			       size_t size, struct iommu_iotlb_gather *gather)
+			       size_t size, size_t count, struct iommu_iotlb_gather *gather)
 {
 	struct omap_iommu_domain *omap_domain = to_omap_domain(domain);
 	struct device *dev = omap_domain->dev;
@@ -1740,8 +1743,8 @@ static const struct iommu_ops omap_iommu_ops = {
 	.pgsize_bitmap	= OMAP_IOMMU_PGSIZES,
 	.default_domain_ops = &(const struct iommu_domain_ops) {
 		.attach_dev	= omap_iommu_attach_dev,
-		.map		= omap_iommu_map,
-		.unmap		= omap_iommu_unmap,
+		.map_pages	= omap_iommu_map,
+		.unmap_pages	= omap_iommu_unmap,
 		.iova_to_phys	= omap_iommu_iova_to_phys,
 		.free		= omap_iommu_domain_free,
 	}
-- 
2.39.2.101.g768bb238c484.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-09-12 16:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 16:18 [PATCH 0/8] iommu: Clean up map/unmap ops Robin Murphy
2023-09-12 16:18 ` [PATCH 1/8] iommu/exynos: Update to {map,unmap}_pages Robin Murphy
2023-09-12 16:18 ` Robin Murphy [this message]
2023-09-12 16:18 ` [PATCH 3/8] iommu/rockchip: " Robin Murphy
2023-09-12 16:18 ` [PATCH 4/8] iommu/sun50i: " Robin Murphy
2023-09-12 16:18 ` [PATCH 5/8] iommu/tegra-gart: " Robin Murphy
2023-09-12 16:18 ` [PATCH 6/8] iommu/tegra-smmu: " Robin Murphy
2023-09-12 16:18 ` [PATCH 7/8] iommu: Retire map/unmap ops Robin Murphy
2023-09-13 14:40   ` Jason Gunthorpe
2023-09-12 16:18 ` [PATCH 8/8] iommu: Improve map/unmap sanity checks Robin Murphy
2023-09-13 14:39   ` Jason Gunthorpe
2023-09-13 18:46     ` Robin Murphy
2023-09-14 12:48       ` Jason Gunthorpe
2023-09-14 14:23         ` Robin Murphy
2023-09-14 16:48           ` Jason Gunthorpe
2023-09-19 12:18             ` Robin Murphy
2023-09-22 17:28               ` Jason Gunthorpe
2023-09-25 10:05 ` [PATCH 0/8] iommu: Clean up map/unmap ops Joerg Roedel
2023-09-25 15:33   ` Jernej Škrabec
2023-09-26  9:23     ` Joerg Roedel
2023-09-26 12:01       ` Robin Murphy
2023-09-26 14:57         ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bad94ffccd4cba32bded72e0860974012881e24.1694525662.git.robin.murphy@arm.com \
    --to=robin.murphy@arm.com \
    --cc=heiko@sntech.de \
    --cc=iommu@lists.linux.dev \
    --cc=jernej.skrabec@gmail.com \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=m.szyprowski@samsung.com \
    --cc=thierry.reding@gmail.com \
    --cc=vdumpa@nvidia.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).