linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Introduce generic_single_device_group()
@ 2023-08-22 16:15 Jason Gunthorpe
  2023-08-22 16:15 ` [PATCH 1/7] iommu: Remove useless group refcounting Jason Gunthorpe
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2023-08-22 16:15 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

This was previously part of the reverted locking rework, but it stands
alone just fine. It has already been in linux-next for a few weeks, this
folds the bug fix from:

https://lore.kernel.org/all/e5e75222-13a9-ee01-0c25-8311b622fe0d@samsung.com/

The patch "iommu: Add a lockdep assertion for remaining dev->iommu_group
reads" is pushed out of this series, even though the logic and explanation
behind that is still correct.

Jason Gunthorpe (7):
  iommu: Remove useless group refcounting
  iommu: Add generic_single_device_group()
  iommu/sun50i: Convert to generic_single_device_group()
  iommu/sprd: Convert to generic_single_device_group()
  iommu/rockchip: Convert to generic_single_device_group()
  iommu/ipmmu-vmsa: Convert to generic_single_device_group()
  iommu/omap: Convert to generic_single_device_group()

 drivers/iommu/iommu.c          | 85 +++++++++++++++++++---------------
 drivers/iommu/ipmmu-vmsa.c     | 22 ++-------
 drivers/iommu/omap-iommu.c     | 30 ++----------
 drivers/iommu/omap-iommu.h     |  2 +-
 drivers/iommu/rockchip-iommu.c | 22 +--------
 drivers/iommu/sprd-iommu.c     | 24 +---------
 drivers/iommu/sun50i-iommu.c   | 29 +++---------
 include/linux/iommu.h          |  3 ++
 8 files changed, 71 insertions(+), 146 deletions(-)


base-commit: d8fe59f11096d6470b5f53739e49cdce67f3e127
-- 
2.41.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/7] iommu: Remove useless group refcounting
  2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
@ 2023-08-22 16:15 ` Jason Gunthorpe
  2023-08-22 16:15 ` [PATCH 2/7] iommu: Add generic_single_device_group() Jason Gunthorpe
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2023-08-22 16:15 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

Several functions obtain the group reference and then release it before
returning. This gives the impression that the refcount is protecting
something for the duration of the function.

In truth all of these functions are called in places that know a device
driver is probed to the device and our locking rules already require
that dev->iommu_group cannot change while a driver is attached to the
struct device.

If this was not the case then this code is already at risk of triggering
UAF as it is racy if the dev->iommu_group is concurrently going to
NULL/free. refcount debugging will throw a WARN if kobject_get() is
called on a 0 refcount object to highlight the bug.

Remove the confusing refcounting and leave behind a comment about the
restriction.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/iommu.c | 57 ++++++++++++++++---------------------------
 1 file changed, 21 insertions(+), 36 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 39601fbfd0e0ca..50afc55eaca8e6 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -2017,10 +2017,10 @@ static int __iommu_attach_device(struct iommu_domain *domain,
  */
 int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
 {
-	struct iommu_group *group;
+	/* Caller must be a probed driver on dev */
+	struct iommu_group *group = dev->iommu_group;
 	int ret;
 
-	group = iommu_group_get(dev);
 	if (!group)
 		return -ENODEV;
 
@@ -2037,8 +2037,6 @@ int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
 
 out_unlock:
 	mutex_unlock(&group->mutex);
-	iommu_group_put(group);
-
 	return ret;
 }
 EXPORT_SYMBOL_GPL(iommu_attach_device);
@@ -2053,9 +2051,9 @@ int iommu_deferred_attach(struct device *dev, struct iommu_domain *domain)
 
 void iommu_detach_device(struct iommu_domain *domain, struct device *dev)
 {
-	struct iommu_group *group;
+	/* Caller must be a probed driver on dev */
+	struct iommu_group *group = dev->iommu_group;
 
-	group = iommu_group_get(dev);
 	if (!group)
 		return;
 
@@ -2067,24 +2065,18 @@ void iommu_detach_device(struct iommu_domain *domain, struct device *dev)
 
 out_unlock:
 	mutex_unlock(&group->mutex);
-	iommu_group_put(group);
 }
 EXPORT_SYMBOL_GPL(iommu_detach_device);
 
 struct iommu_domain *iommu_get_domain_for_dev(struct device *dev)
 {
-	struct iommu_domain *domain;
-	struct iommu_group *group;
+	/* Caller must be a probed driver on dev */
+	struct iommu_group *group = dev->iommu_group;
 
-	group = iommu_group_get(dev);
 	if (!group)
 		return NULL;
 
-	domain = group->domain;
-
-	iommu_group_put(group);
-
-	return domain;
+	return group->domain;
 }
 EXPORT_SYMBOL_GPL(iommu_get_domain_for_dev);
 
@@ -3062,7 +3054,8 @@ static bool iommu_is_default_domain(struct iommu_group *group)
  */
 int iommu_device_use_default_domain(struct device *dev)
 {
-	struct iommu_group *group = iommu_group_get(dev);
+	/* Caller is the driver core during the pre-probe path */
+	struct iommu_group *group = dev->iommu_group;
 	int ret = 0;
 
 	if (!group)
@@ -3081,8 +3074,6 @@ int iommu_device_use_default_domain(struct device *dev)
 
 unlock_out:
 	mutex_unlock(&group->mutex);
-	iommu_group_put(group);
-
 	return ret;
 }
 
@@ -3096,7 +3087,8 @@ int iommu_device_use_default_domain(struct device *dev)
  */
 void iommu_device_unuse_default_domain(struct device *dev)
 {
-	struct iommu_group *group = iommu_group_get(dev);
+	/* Caller is the driver core during the post-probe path */
+	struct iommu_group *group = dev->iommu_group;
 
 	if (!group)
 		return;
@@ -3106,7 +3098,6 @@ void iommu_device_unuse_default_domain(struct device *dev)
 		group->owner_cnt--;
 
 	mutex_unlock(&group->mutex);
-	iommu_group_put(group);
 }
 
 static int __iommu_group_alloc_blocking_domain(struct iommu_group *group)
@@ -3193,13 +3184,13 @@ EXPORT_SYMBOL_GPL(iommu_group_claim_dma_owner);
  */
 int iommu_device_claim_dma_owner(struct device *dev, void *owner)
 {
-	struct iommu_group *group;
+	/* Caller must be a probed driver on dev */
+	struct iommu_group *group = dev->iommu_group;
 	int ret = 0;
 
 	if (WARN_ON(!owner))
 		return -EINVAL;
 
-	group = iommu_group_get(dev);
 	if (!group)
 		return -ENODEV;
 
@@ -3216,8 +3207,6 @@ int iommu_device_claim_dma_owner(struct device *dev, void *owner)
 	ret = __iommu_take_dma_ownership(group, owner);
 unlock_out:
 	mutex_unlock(&group->mutex);
-	iommu_group_put(group);
-
 	return ret;
 }
 EXPORT_SYMBOL_GPL(iommu_device_claim_dma_owner);
@@ -3255,7 +3244,8 @@ EXPORT_SYMBOL_GPL(iommu_group_release_dma_owner);
  */
 void iommu_device_release_dma_owner(struct device *dev)
 {
-	struct iommu_group *group = iommu_group_get(dev);
+	/* Caller must be a probed driver on dev */
+	struct iommu_group *group = dev->iommu_group;
 
 	mutex_lock(&group->mutex);
 	if (group->owner_cnt > 1)
@@ -3263,7 +3253,6 @@ void iommu_device_release_dma_owner(struct device *dev)
 	else
 		__iommu_release_dma_ownership(group);
 	mutex_unlock(&group->mutex);
-	iommu_group_put(group);
 }
 EXPORT_SYMBOL_GPL(iommu_device_release_dma_owner);
 
@@ -3324,14 +3313,14 @@ static void __iommu_remove_group_pasid(struct iommu_group *group,
 int iommu_attach_device_pasid(struct iommu_domain *domain,
 			      struct device *dev, ioasid_t pasid)
 {
-	struct iommu_group *group;
+	/* Caller must be a probed driver on dev */
+	struct iommu_group *group = dev->iommu_group;
 	void *curr;
 	int ret;
 
 	if (!domain->ops->set_dev_pasid)
 		return -EOPNOTSUPP;
 
-	group = iommu_group_get(dev);
 	if (!group)
 		return -ENODEV;
 
@@ -3349,8 +3338,6 @@ int iommu_attach_device_pasid(struct iommu_domain *domain,
 	}
 out_unlock:
 	mutex_unlock(&group->mutex);
-	iommu_group_put(group);
-
 	return ret;
 }
 EXPORT_SYMBOL_GPL(iommu_attach_device_pasid);
@@ -3367,14 +3354,13 @@ EXPORT_SYMBOL_GPL(iommu_attach_device_pasid);
 void iommu_detach_device_pasid(struct iommu_domain *domain, struct device *dev,
 			       ioasid_t pasid)
 {
-	struct iommu_group *group = iommu_group_get(dev);
+	/* Caller must be a probed driver on dev */
+	struct iommu_group *group = dev->iommu_group;
 
 	mutex_lock(&group->mutex);
 	__iommu_remove_group_pasid(group, pasid);
 	WARN_ON(xa_erase(&group->pasid_array, pasid) != domain);
 	mutex_unlock(&group->mutex);
-
-	iommu_group_put(group);
 }
 EXPORT_SYMBOL_GPL(iommu_detach_device_pasid);
 
@@ -3396,10 +3382,10 @@ struct iommu_domain *iommu_get_domain_for_dev_pasid(struct device *dev,
 						    ioasid_t pasid,
 						    unsigned int type)
 {
+	/* Caller must be a probed driver on dev */
+	struct iommu_group *group = dev->iommu_group;
 	struct iommu_domain *domain;
-	struct iommu_group *group;
 
-	group = iommu_group_get(dev);
 	if (!group)
 		return NULL;
 
@@ -3408,7 +3394,6 @@ struct iommu_domain *iommu_get_domain_for_dev_pasid(struct device *dev,
 	if (type && domain && domain->type != type)
 		domain = ERR_PTR(-EBUSY);
 	xa_unlock(&group->pasid_array);
-	iommu_group_put(group);
 
 	return domain;
 }
-- 
2.41.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/7] iommu: Add generic_single_device_group()
  2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
  2023-08-22 16:15 ` [PATCH 1/7] iommu: Remove useless group refcounting Jason Gunthorpe
@ 2023-08-22 16:15 ` Jason Gunthorpe
  2023-08-22 16:15 ` [PATCH 3/7] iommu/sun50i: Convert to generic_single_device_group() Jason Gunthorpe
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2023-08-22 16:15 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

This implements the common pattern seen in drivers of a single iommu_group
for the entire iommu driver instance. Implement this in core code so the
drivers that want this can select it from their ops.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/iommu.c | 28 +++++++++++++++++++++++++++-
 include/linux/iommu.h |  3 +++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 50afc55eaca8e6..3d6bb2537e8d85 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -288,6 +288,10 @@ void iommu_device_unregister(struct iommu_device *iommu)
 	spin_lock(&iommu_device_lock);
 	list_del(&iommu->list);
 	spin_unlock(&iommu_device_lock);
+
+	/* Pairs with the alloc in generic_single_device_group() */
+	iommu_group_put(iommu->singleton_group);
+	iommu->singleton_group = NULL;
 }
 EXPORT_SYMBOL_GPL(iommu_device_unregister);
 
@@ -360,6 +364,7 @@ static int iommu_init_device(struct device *dev, const struct iommu_ops *ops)
 		ret = PTR_ERR(iommu_dev);
 		goto err_module_put;
 	}
+	dev->iommu->iommu_dev = iommu_dev;
 
 	ret = iommu_device_link(iommu_dev, dev);
 	if (ret)
@@ -374,7 +379,6 @@ static int iommu_init_device(struct device *dev, const struct iommu_ops *ops)
 	}
 	dev->iommu_group = group;
 
-	dev->iommu->iommu_dev = iommu_dev;
 	dev->iommu->max_pasids = dev_iommu_get_max_pasids(dev);
 	if (ops->is_attach_deferred)
 		dev->iommu->attach_deferred = ops->is_attach_deferred(dev);
@@ -388,6 +392,7 @@ static int iommu_init_device(struct device *dev, const struct iommu_ops *ops)
 err_module_put:
 	module_put(ops->owner);
 err_free:
+	dev->iommu->iommu_dev = NULL;
 	dev_iommu_free(dev);
 	return ret;
 }
@@ -1591,6 +1596,27 @@ struct iommu_group *generic_device_group(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(generic_device_group);
 
+/*
+ * Generic device_group call-back function. It just allocates one
+ * iommu-group per iommu driver instance shared by every device
+ * probed by that iommu driver.
+ */
+struct iommu_group *generic_single_device_group(struct device *dev)
+{
+	struct iommu_device *iommu = dev->iommu->iommu_dev;
+
+	if (!iommu->singleton_group) {
+		struct iommu_group *group;
+
+		group = iommu_group_alloc();
+		if (IS_ERR(group))
+			return group;
+		iommu->singleton_group = group;
+	}
+	return iommu_group_ref_get(iommu->singleton_group);
+}
+EXPORT_SYMBOL_GPL(generic_single_device_group);
+
 /*
  * Use standard PCI bus topology, isolation features, and DMA alias quirks
  * to find or create an IOMMU group for a device.
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 389fffc0b3a2df..9ed139bf111f6d 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -363,6 +363,7 @@ struct iommu_domain_ops {
  * @list: Used by the iommu-core to keep a list of registered iommus
  * @ops: iommu-ops for talking to this iommu
  * @dev: struct device for sysfs handling
+ * @singleton_group: Used internally for drivers that have only one group
  * @max_pasids: number of supported PASIDs
  */
 struct iommu_device {
@@ -370,6 +371,7 @@ struct iommu_device {
 	const struct iommu_ops *ops;
 	struct fwnode_handle *fwnode;
 	struct device *dev;
+	struct iommu_group *singleton_group;
 	u32 max_pasids;
 };
 
@@ -644,6 +646,7 @@ extern struct iommu_group *pci_device_group(struct device *dev);
 extern struct iommu_group *generic_device_group(struct device *dev);
 /* FSL-MC device grouping function */
 struct iommu_group *fsl_mc_device_group(struct device *dev);
+extern struct iommu_group *generic_single_device_group(struct device *dev);
 
 /**
  * struct iommu_fwspec - per-device IOMMU instance data
-- 
2.41.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/7] iommu/sun50i: Convert to generic_single_device_group()
  2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
  2023-08-22 16:15 ` [PATCH 1/7] iommu: Remove useless group refcounting Jason Gunthorpe
  2023-08-22 16:15 ` [PATCH 2/7] iommu: Add generic_single_device_group() Jason Gunthorpe
@ 2023-08-22 16:15 ` Jason Gunthorpe
  2023-08-23 19:22   ` Jernej Škrabec
  2023-08-22 16:15 ` [PATCH 4/7] iommu/sprd: " Jason Gunthorpe
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2023-08-22 16:15 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

Use the new helper.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/sun50i-iommu.c | 29 ++++++-----------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index 74c5cb93e90027..b8df655185ab2a 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -107,7 +107,6 @@ struct sun50i_iommu {
 	struct clk *clk;
 
 	struct iommu_domain *domain;
-	struct iommu_group *group;
 	struct kmem_cache *pt_pool;
 };
 
@@ -808,13 +807,6 @@ static struct iommu_device *sun50i_iommu_probe_device(struct device *dev)
 	return &iommu->iommu;
 }
 
-static struct iommu_group *sun50i_iommu_device_group(struct device *dev)
-{
-	struct sun50i_iommu *iommu = sun50i_iommu_from_dev(dev);
-
-	return iommu_group_ref_get(iommu->group);
-}
-
 static int sun50i_iommu_of_xlate(struct device *dev,
 				 struct of_phandle_args *args)
 {
@@ -828,7 +820,7 @@ static int sun50i_iommu_of_xlate(struct device *dev,
 
 static const struct iommu_ops sun50i_iommu_ops = {
 	.pgsize_bitmap	= SZ_4K,
-	.device_group	= sun50i_iommu_device_group,
+	.device_group	= generic_single_device_group,
 	.domain_alloc	= sun50i_iommu_domain_alloc,
 	.of_xlate	= sun50i_iommu_of_xlate,
 	.probe_device	= sun50i_iommu_probe_device,
@@ -995,42 +987,36 @@ static int sun50i_iommu_probe(struct platform_device *pdev)
 	if (!iommu->pt_pool)
 		return -ENOMEM;
 
-	iommu->group = iommu_group_alloc();
-	if (IS_ERR(iommu->group)) {
-		ret = PTR_ERR(iommu->group);
-		goto err_free_cache;
-	}
-
 	iommu->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(iommu->base)) {
 		ret = PTR_ERR(iommu->base);
-		goto err_free_group;
+		goto err_free_cache;
 	}
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
 		ret = irq;
-		goto err_free_group;
+		goto err_free_cache;
 	}
 
 	iommu->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(iommu->clk)) {
 		dev_err(&pdev->dev, "Couldn't get our clock.\n");
 		ret = PTR_ERR(iommu->clk);
-		goto err_free_group;
+		goto err_free_cache;
 	}
 
 	iommu->reset = devm_reset_control_get(&pdev->dev, NULL);
 	if (IS_ERR(iommu->reset)) {
 		dev_err(&pdev->dev, "Couldn't get our reset line.\n");
 		ret = PTR_ERR(iommu->reset);
-		goto err_free_group;
+		goto err_free_cache;
 	}
 
 	ret = iommu_device_sysfs_add(&iommu->iommu, &pdev->dev,
 				     NULL, dev_name(&pdev->dev));
 	if (ret)
-		goto err_free_group;
+		goto err_free_cache;
 
 	ret = iommu_device_register(&iommu->iommu, &sun50i_iommu_ops, &pdev->dev);
 	if (ret)
@@ -1049,9 +1035,6 @@ static int sun50i_iommu_probe(struct platform_device *pdev)
 err_remove_sysfs:
 	iommu_device_sysfs_remove(&iommu->iommu);
 
-err_free_group:
-	iommu_group_put(iommu->group);
-
 err_free_cache:
 	kmem_cache_destroy(iommu->pt_pool);
 
-- 
2.41.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/7] iommu/sprd: Convert to generic_single_device_group()
  2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
                   ` (2 preceding siblings ...)
  2023-08-22 16:15 ` [PATCH 3/7] iommu/sun50i: Convert to generic_single_device_group() Jason Gunthorpe
@ 2023-08-22 16:15 ` Jason Gunthorpe
  2023-08-22 16:16 ` [PATCH 5/7] iommu/rockchip: " Jason Gunthorpe
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2023-08-22 16:15 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

Use the new helper.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/sprd-iommu.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c
index 2fa9afebd4f5f0..1ca22368649884 100644
--- a/drivers/iommu/sprd-iommu.c
+++ b/drivers/iommu/sprd-iommu.c
@@ -70,7 +70,6 @@ struct sprd_iommu_device {
 	void __iomem		*base;
 	struct device		*dev;
 	struct iommu_device	iommu;
-	struct iommu_group	*group;
 	struct clk		*eb;
 };
 
@@ -399,13 +398,6 @@ static struct iommu_device *sprd_iommu_probe_device(struct device *dev)
 	return &sdev->iommu;
 }
 
-static struct iommu_group *sprd_iommu_device_group(struct device *dev)
-{
-	struct sprd_iommu_device *sdev = dev_iommu_priv_get(dev);
-
-	return iommu_group_ref_get(sdev->group);
-}
-
 static int sprd_iommu_of_xlate(struct device *dev, struct of_phandle_args *args)
 {
 	struct platform_device *pdev;
@@ -423,7 +415,7 @@ static int sprd_iommu_of_xlate(struct device *dev, struct of_phandle_args *args)
 static const struct iommu_ops sprd_iommu_ops = {
 	.domain_alloc	= sprd_iommu_domain_alloc,
 	.probe_device	= sprd_iommu_probe_device,
-	.device_group	= sprd_iommu_device_group,
+	.device_group	= generic_single_device_group,
 	.of_xlate	= sprd_iommu_of_xlate,
 	.pgsize_bitmap	= SPRD_IOMMU_PAGE_SIZE,
 	.owner		= THIS_MODULE,
@@ -496,16 +488,9 @@ static int sprd_iommu_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, sdev);
 	sdev->dev = dev;
 
-	/* All the client devices are in the same iommu-group */
-	sdev->group = iommu_group_alloc();
-	if (IS_ERR(sdev->group)) {
-		ret = PTR_ERR(sdev->group);
-		goto free_page;
-	}
-
 	ret = iommu_device_sysfs_add(&sdev->iommu, dev, NULL, dev_name(dev));
 	if (ret)
-		goto put_group;
+		goto free_page;
 
 	ret = iommu_device_register(&sdev->iommu, &sprd_iommu_ops, dev);
 	if (ret)
@@ -530,8 +515,6 @@ static int sprd_iommu_probe(struct platform_device *pdev)
 	iommu_device_unregister(&sdev->iommu);
 remove_sysfs:
 	iommu_device_sysfs_remove(&sdev->iommu);
-put_group:
-	iommu_group_put(sdev->group);
 free_page:
 	dma_free_coherent(sdev->dev, SPRD_IOMMU_PAGE_SIZE, sdev->prot_page_va, sdev->prot_page_pa);
 	return ret;
@@ -543,9 +526,6 @@ static void sprd_iommu_remove(struct platform_device *pdev)
 
 	dma_free_coherent(sdev->dev, SPRD_IOMMU_PAGE_SIZE, sdev->prot_page_va, sdev->prot_page_pa);
 
-	iommu_group_put(sdev->group);
-	sdev->group = NULL;
-
 	platform_set_drvdata(pdev, NULL);
 	iommu_device_sysfs_remove(&sdev->iommu);
 	iommu_device_unregister(&sdev->iommu);
-- 
2.41.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/7] iommu/rockchip: Convert to generic_single_device_group()
  2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
                   ` (3 preceding siblings ...)
  2023-08-22 16:15 ` [PATCH 4/7] iommu/sprd: " Jason Gunthorpe
@ 2023-08-22 16:16 ` Jason Gunthorpe
  2023-08-22 16:16 ` [PATCH 6/7] iommu/ipmmu-vmsa: " Jason Gunthorpe
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2023-08-22 16:16 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

Use the new helper.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/rockchip-iommu.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 8ff69fbf9f65db..91f13cc9411548 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -113,7 +113,6 @@ struct rk_iommu {
 	struct iommu_device iommu;
 	struct list_head node; /* entry in rk_iommu_domain.iommus */
 	struct iommu_domain *domain; /* domain to which iommu is attached */
-	struct iommu_group *group;
 };
 
 struct rk_iommudata {
@@ -1155,15 +1154,6 @@ static void rk_iommu_release_device(struct device *dev)
 	device_link_del(data->link);
 }
 
-static struct iommu_group *rk_iommu_device_group(struct device *dev)
-{
-	struct rk_iommu *iommu;
-
-	iommu = rk_iommu_from_dev(dev);
-
-	return iommu_group_ref_get(iommu->group);
-}
-
 static int rk_iommu_of_xlate(struct device *dev,
 			     struct of_phandle_args *args)
 {
@@ -1189,7 +1179,7 @@ static const struct iommu_ops rk_iommu_ops = {
 	.domain_alloc = rk_iommu_domain_alloc,
 	.probe_device = rk_iommu_probe_device,
 	.release_device = rk_iommu_release_device,
-	.device_group = rk_iommu_device_group,
+	.device_group = generic_single_device_group,
 #ifdef CONFIG_ARM
 	.set_platform_dma_ops = rk_iommu_set_platform_dma,
 #endif
@@ -1280,15 +1270,9 @@ static int rk_iommu_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	iommu->group = iommu_group_alloc();
-	if (IS_ERR(iommu->group)) {
-		err = PTR_ERR(iommu->group);
-		goto err_unprepare_clocks;
-	}
-
 	err = iommu_device_sysfs_add(&iommu->iommu, dev, NULL, dev_name(dev));
 	if (err)
-		goto err_put_group;
+		goto err_unprepare_clocks;
 
 	err = iommu_device_register(&iommu->iommu, &rk_iommu_ops, dev);
 	if (err)
@@ -1325,8 +1309,6 @@ static int rk_iommu_probe(struct platform_device *pdev)
 	pm_runtime_disable(dev);
 err_remove_sysfs:
 	iommu_device_sysfs_remove(&iommu->iommu);
-err_put_group:
-	iommu_group_put(iommu->group);
 err_unprepare_clocks:
 	clk_bulk_unprepare(iommu->num_clocks, iommu->clocks);
 	return err;
-- 
2.41.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/7] iommu/ipmmu-vmsa: Convert to generic_single_device_group()
  2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
                   ` (4 preceding siblings ...)
  2023-08-22 16:16 ` [PATCH 5/7] iommu/rockchip: " Jason Gunthorpe
@ 2023-08-22 16:16 ` Jason Gunthorpe
  2023-08-22 16:16 ` [PATCH 7/7] iommu/omap: " Jason Gunthorpe
  2023-09-25  9:53 ` [PATCH 0/7] Introduce generic_single_device_group() Joerg Roedel
  7 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2023-08-22 16:16 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

Use the new helper.

This driver is kind of weird since in ARM mode it pretends it has
per-device groups, but ARM64 mode does not.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/ipmmu-vmsa.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 65ff69477c43e4..8e198776ccff80 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -64,7 +64,6 @@ struct ipmmu_vmsa_device {
 	struct ipmmu_vmsa_domain *domains[IPMMU_CTX_MAX];
 	s8 utlb_ctx[IPMMU_UTLB_MAX];
 
-	struct iommu_group *group;
 	struct dma_iommu_mapping *mapping;
 };
 
@@ -833,28 +832,17 @@ static void ipmmu_release_device(struct device *dev)
 	arm_iommu_release_mapping(mmu->mapping);
 }
 
-static struct iommu_group *ipmmu_find_group(struct device *dev)
-{
-	struct ipmmu_vmsa_device *mmu = to_ipmmu(dev);
-	struct iommu_group *group;
-
-	if (mmu->group)
-		return iommu_group_ref_get(mmu->group);
-
-	group = iommu_group_alloc();
-	if (!IS_ERR(group))
-		mmu->group = group;
-
-	return group;
-}
-
 static const struct iommu_ops ipmmu_ops = {
 	.domain_alloc = ipmmu_domain_alloc,
 	.probe_device = ipmmu_probe_device,
 	.release_device = ipmmu_release_device,
 	.probe_finalize = ipmmu_probe_finalize,
+	/*
+	 * FIXME: The device grouping is a fixed property of the hardware's
+	 * ability to isolate and control DMA, it should not depend on kconfig.
+	 */
 	.device_group = IS_ENABLED(CONFIG_ARM) && !IS_ENABLED(CONFIG_IOMMU_DMA)
-			? generic_device_group : ipmmu_find_group,
+			? generic_device_group : generic_single_device_group,
 	.pgsize_bitmap = SZ_1G | SZ_2M | SZ_4K,
 	.of_xlate = ipmmu_of_xlate,
 	.default_domain_ops = &(const struct iommu_domain_ops) {
-- 
2.41.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/7] iommu/omap: Convert to generic_single_device_group()
  2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
                   ` (5 preceding siblings ...)
  2023-08-22 16:16 ` [PATCH 6/7] iommu/ipmmu-vmsa: " Jason Gunthorpe
@ 2023-08-22 16:16 ` Jason Gunthorpe
  2023-09-25  9:53 ` [PATCH 0/7] Introduce generic_single_device_group() Joerg Roedel
  7 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2023-08-22 16:16 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

Use the new helper.

For some reason omap will probe its driver even if it doesn't load an
iommu driver. Keep this working by keeping a bool to track if the iommu
driver was started.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/omap-iommu.c | 30 ++++--------------------------
 drivers/iommu/omap-iommu.h |  2 +-
 2 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 537e402f9bba97..97c45f50bf4332 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1225,18 +1225,15 @@ static int omap_iommu_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, obj);
 
 	if (omap_iommu_can_register(pdev)) {
-		obj->group = iommu_group_alloc();
-		if (IS_ERR(obj->group))
-			return PTR_ERR(obj->group);
-
 		err = iommu_device_sysfs_add(&obj->iommu, obj->dev, NULL,
 					     obj->name);
 		if (err)
-			goto out_group;
+			return err;
 
 		err = iommu_device_register(&obj->iommu, &omap_iommu_ops, &pdev->dev);
 		if (err)
 			goto out_sysfs;
+		obj->has_iommu_driver = true;
 	}
 
 	pm_runtime_enable(obj->dev);
@@ -1252,8 +1249,6 @@ static int omap_iommu_probe(struct platform_device *pdev)
 
 out_sysfs:
 	iommu_device_sysfs_remove(&obj->iommu);
-out_group:
-	iommu_group_put(obj->group);
 	return err;
 }
 
@@ -1261,10 +1256,7 @@ static void omap_iommu_remove(struct platform_device *pdev)
 {
 	struct omap_iommu *obj = platform_get_drvdata(pdev);
 
-	if (obj->group) {
-		iommu_group_put(obj->group);
-		obj->group = NULL;
-
+	if (obj->has_iommu_driver) {
 		iommu_device_sysfs_remove(&obj->iommu);
 		iommu_device_unregister(&obj->iommu);
 	}
@@ -1717,25 +1709,11 @@ static void omap_iommu_release_device(struct device *dev)
 
 }
 
-static struct iommu_group *omap_iommu_device_group(struct device *dev)
-{
-	struct omap_iommu_arch_data *arch_data = dev_iommu_priv_get(dev);
-	struct iommu_group *group = ERR_PTR(-EINVAL);
-
-	if (!arch_data)
-		return ERR_PTR(-ENODEV);
-
-	if (arch_data->iommu_dev)
-		group = iommu_group_ref_get(arch_data->iommu_dev->group);
-
-	return group;
-}
-
 static const struct iommu_ops omap_iommu_ops = {
 	.domain_alloc	= omap_iommu_domain_alloc,
 	.probe_device	= omap_iommu_probe_device,
 	.release_device	= omap_iommu_release_device,
-	.device_group	= omap_iommu_device_group,
+	.device_group	= generic_single_device_group,
 	.set_platform_dma_ops = omap_iommu_set_platform_dma,
 	.pgsize_bitmap	= OMAP_IOMMU_PGSIZES,
 	.default_domain_ops = &(const struct iommu_domain_ops) {
diff --git a/drivers/iommu/omap-iommu.h b/drivers/iommu/omap-iommu.h
index 18ee713ede784d..27697109ec79a5 100644
--- a/drivers/iommu/omap-iommu.h
+++ b/drivers/iommu/omap-iommu.h
@@ -80,7 +80,7 @@ struct omap_iommu {
 	u32 id;
 
 	struct iommu_device iommu;
-	struct iommu_group *group;
+	bool has_iommu_driver;
 
 	u8 pwrst;
 };
-- 
2.41.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/7] iommu/sun50i: Convert to generic_single_device_group()
  2023-08-22 16:15 ` [PATCH 3/7] iommu/sun50i: Convert to generic_single_device_group() Jason Gunthorpe
@ 2023-08-23 19:22   ` Jernej Škrabec
  0 siblings, 0 replies; 11+ messages in thread
From: Jernej Škrabec @ 2023-08-23 19:22 UTC (permalink / raw)
  To: Baolin Wang, Heiko Stuebner, iommu, Joerg Roedel,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang, Jason Gunthorpe
  Cc: Lu Baolu, Kevin Tian, Marek Szyprowski

Dne torek, 22. avgust 2023 ob 18:15:58 CEST je Jason Gunthorpe napisal(a):
> Use the new helper.
> 
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/iommu/sun50i-iommu.c | 29 ++++++-----------------------
>  1 file changed, 6 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
> index 74c5cb93e90027..b8df655185ab2a 100644
> --- a/drivers/iommu/sun50i-iommu.c
> +++ b/drivers/iommu/sun50i-iommu.c
> @@ -107,7 +107,6 @@ struct sun50i_iommu {
>  	struct clk *clk;
> 
>  	struct iommu_domain *domain;
> -	struct iommu_group *group;
>  	struct kmem_cache *pt_pool;
>  };
> 
> @@ -808,13 +807,6 @@ static struct iommu_device
> *sun50i_iommu_probe_device(struct device *dev) return &iommu->iommu;
>  }
> 
> -static struct iommu_group *sun50i_iommu_device_group(struct device *dev)
> -{
> -	struct sun50i_iommu *iommu = sun50i_iommu_from_dev(dev);
> -
> -	return iommu_group_ref_get(iommu->group);
> -}
> -
>  static int sun50i_iommu_of_xlate(struct device *dev,
>  				 struct of_phandle_args *args)
>  {
> @@ -828,7 +820,7 @@ static int sun50i_iommu_of_xlate(struct device *dev,
> 
>  static const struct iommu_ops sun50i_iommu_ops = {
>  	.pgsize_bitmap	= SZ_4K,
> -	.device_group	= sun50i_iommu_device_group,
> +	.device_group	= generic_single_device_group,
>  	.domain_alloc	= sun50i_iommu_domain_alloc,
>  	.of_xlate	= sun50i_iommu_of_xlate,
>  	.probe_device	= sun50i_iommu_probe_device,
> @@ -995,42 +987,36 @@ static int sun50i_iommu_probe(struct platform_device
> *pdev) if (!iommu->pt_pool)
>  		return -ENOMEM;
> 
> -	iommu->group = iommu_group_alloc();
> -	if (IS_ERR(iommu->group)) {
> -		ret = PTR_ERR(iommu->group);
> -		goto err_free_cache;
> -	}
> -
>  	iommu->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(iommu->base)) {
>  		ret = PTR_ERR(iommu->base);
> -		goto err_free_group;
> +		goto err_free_cache;
>  	}
> 
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0) {
>  		ret = irq;
> -		goto err_free_group;
> +		goto err_free_cache;
>  	}
> 
>  	iommu->clk = devm_clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(iommu->clk)) {
>  		dev_err(&pdev->dev, "Couldn't get our clock.\n");
>  		ret = PTR_ERR(iommu->clk);
> -		goto err_free_group;
> +		goto err_free_cache;
>  	}
> 
>  	iommu->reset = devm_reset_control_get(&pdev->dev, NULL);
>  	if (IS_ERR(iommu->reset)) {
>  		dev_err(&pdev->dev, "Couldn't get our reset line.\n");
>  		ret = PTR_ERR(iommu->reset);
> -		goto err_free_group;
> +		goto err_free_cache;
>  	}
> 
>  	ret = iommu_device_sysfs_add(&iommu->iommu, &pdev->dev,
>  				     NULL, dev_name(&pdev->dev));
>  	if (ret)
> -		goto err_free_group;
> +		goto err_free_cache;
> 
>  	ret = iommu_device_register(&iommu->iommu, &sun50i_iommu_ops, 
&pdev->dev);
> if (ret)
> @@ -1049,9 +1035,6 @@ static int sun50i_iommu_probe(struct platform_device
> *pdev) err_remove_sysfs:
>  	iommu_device_sysfs_remove(&iommu->iommu);
> 
> -err_free_group:
> -	iommu_group_put(iommu->group);
> -
>  err_free_cache:
>  	kmem_cache_destroy(iommu->pt_pool);





_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/7] Introduce generic_single_device_group()
  2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
                   ` (6 preceding siblings ...)
  2023-08-22 16:16 ` [PATCH 7/7] iommu/omap: " Jason Gunthorpe
@ 2023-09-25  9:53 ` Joerg Roedel
  2023-09-25 11:42   ` Jason Gunthorpe
  7 siblings, 1 reply; 11+ messages in thread
From: Joerg Roedel @ 2023-09-25  9:53 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang, Lu Baolu, Kevin Tian, Marek Szyprowski

On Tue, Aug 22, 2023 at 01:15:55PM -0300, Jason Gunthorpe wrote:
> Jason Gunthorpe (7):
>   iommu: Remove useless group refcounting
>   iommu: Add generic_single_device_group()
>   iommu/sun50i: Convert to generic_single_device_group()
>   iommu/sprd: Convert to generic_single_device_group()
>   iommu/rockchip: Convert to generic_single_device_group()
>   iommu/ipmmu-vmsa: Convert to generic_single_device_group()
>   iommu/omap: Convert to generic_single_device_group()

Applied on-top of the default-domain patch-set, thanks.

It caused some conflicts, but those were easy to resolve.

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/7] Introduce generic_single_device_group()
  2023-09-25  9:53 ` [PATCH 0/7] Introduce generic_single_device_group() Joerg Roedel
@ 2023-09-25 11:42   ` Jason Gunthorpe
  0 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2023-09-25 11:42 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Baolin Wang, Heiko Stuebner, iommu, Jernej Skrabec,
	linux-arm-kernel, linux-rockchip, linux-sunxi, Orson Zhai,
	Robin Murphy, Samuel Holland, Chen-Yu Tsai, Will Deacon,
	Chunyan Zhang, Lu Baolu, Kevin Tian, Marek Szyprowski

On Mon, Sep 25, 2023 at 11:53:21AM +0200, Joerg Roedel wrote:
> On Tue, Aug 22, 2023 at 01:15:55PM -0300, Jason Gunthorpe wrote:
> > Jason Gunthorpe (7):
> >   iommu: Remove useless group refcounting
> >   iommu: Add generic_single_device_group()
> >   iommu/sun50i: Convert to generic_single_device_group()
> >   iommu/sprd: Convert to generic_single_device_group()
> >   iommu/rockchip: Convert to generic_single_device_group()
> >   iommu/ipmmu-vmsa: Convert to generic_single_device_group()
> >   iommu/omap: Convert to generic_single_device_group()
> 
> Applied on-top of the default-domain patch-set, thanks.
> 
> It caused some conflicts, but those were easy to resolve.

Thanks! I'll double check it

Jason

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-09-25 11:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
2023-08-22 16:15 ` [PATCH 1/7] iommu: Remove useless group refcounting Jason Gunthorpe
2023-08-22 16:15 ` [PATCH 2/7] iommu: Add generic_single_device_group() Jason Gunthorpe
2023-08-22 16:15 ` [PATCH 3/7] iommu/sun50i: Convert to generic_single_device_group() Jason Gunthorpe
2023-08-23 19:22   ` Jernej Škrabec
2023-08-22 16:15 ` [PATCH 4/7] iommu/sprd: " Jason Gunthorpe
2023-08-22 16:16 ` [PATCH 5/7] iommu/rockchip: " Jason Gunthorpe
2023-08-22 16:16 ` [PATCH 6/7] iommu/ipmmu-vmsa: " Jason Gunthorpe
2023-08-22 16:16 ` [PATCH 7/7] iommu/omap: " Jason Gunthorpe
2023-09-25  9:53 ` [PATCH 0/7] Introduce generic_single_device_group() Joerg Roedel
2023-09-25 11:42   ` Jason Gunthorpe

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).