diff mbox series

[v2,11/15] dma-iommu: Reconfig group domain

Message ID 1620656249-68890-12-git-send-email-john.garry@huawei.com
State New
Headers show
Series dma mapping/iommu: Allow IOMMU IOVA rcache range to be configured | expand

Commit Message

John Garry May 10, 2021, 2:17 p.m. UTC
Call iommu_reconfig_dev_group_dma() from iommu_setup_dma_ops() to reconfig
the group domain, if necessary.

Signed-off-by: John Garry <john.garry@huawei.com>

---
 drivers/iommu/dma-iommu.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.26.2
diff mbox series

Patch

diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 574d7a901fd2..1d58c7a2d85d 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -1358,6 +1358,9 @@  void iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size)
 	 * underlying IOMMU driver needs to support via the dma-iommu layer.
 	 */
 	if (domain->type == IOMMU_DOMAIN_DMA) {
+		iommu_reconfig_dev_group_dma(dev);
+		/* domain may be stale ... */
+		domain = iommu_get_domain_for_dev(dev);
 		if (iommu_dma_init_domain(domain, dma_base, size, dev))
 			goto out_err;
 		dev->dma_ops = &iommu_dma_ops;