Skip to contentSkip to conversation

soc/fsl/qbman: Use iommu_paging_domain_alloc()

PATCH In review Lu Baolu 2 participants 2 messages Aug 12, 2024 – Sep 3, 2024 Freescale SoC drivers

lore
Share & tools
lore

Lu Baolu

author
#0 lore raw

PATCH 1/1 soc/fsl/qbman: Use iommu_paging_domain_alloc()

An iommu domain is allocated in portal_set_cpu() and is attached to pcfg->dev in the same function.

Use iommu_paging_domain_alloc() to make it explicit.

---
 drivers/soc/fsl/qbman/qman_portal.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/soc/fsl/qbman/qman_portal.c +3 -2
index e23b60618c1a..456ef5d5c199 100644
@@ -48,9 +48,10 @@ static void portal_set_cpu(struct qm_portal_config *pcfg, int cpu)
 	struct device *dev = pcfg->dev;
 	int ret;
 
-	pcfg->iommu_domain = iommu_domain_alloc(&platform_bus_type);
-	if (!pcfg->iommu_domain) {
+	pcfg->iommu_domain = iommu_paging_domain_alloc(dev);
+	if (IS_ERR(pcfg->iommu_domain)) {
 		dev_err(dev, "%s(): iommu_domain_alloc() failed", __func__);
+		pcfg->iommu_domain = NULL;
 		goto no_iommu;
 	}
 	ret = fsl_pamu_configure_l1_stash(pcfg->iommu_domain, cpu);
Signature · 1 line
2.34.1
#1 lore raw

Le 12/08/2024 à 09:25, Lu Baolu a écrit :

Quoted 32 lines

[Vous ne recevez pas souvent de courriers de [email protected]. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]

An iommu domain is allocated in portal_set_cpu() and is attached to pcfg->dev in the same function.

Use iommu_paging_domain_alloc() to make it explicit.

---
  drivers/soc/fsl/qbman/qman_portal.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/soc/fsl/qbman/qman_portal.c +3 -3
index e23b60618c1a..456ef5d5c199 100644
@@ -48,9 +48,10 @@ static void portal_set_cpu(struct qm_portal_config *pcfg, int cpu)
         struct device *dev = pcfg->dev;
         int ret;
 
-       pcfg->iommu_domain = iommu_domain_alloc(&platform_bus_type);
-       if (!pcfg->iommu_domain) {
+       pcfg->iommu_domain = iommu_paging_domain_alloc(dev);
+       if (IS_ERR(pcfg->iommu_domain)) {
                 dev_err(dev, "%s(): iommu_domain_alloc() failed", __func__);
+               pcfg->iommu_domain = NULL;
                 goto no_iommu;
         }
         ret = fsl_pamu_configure_l1_stash(pcfg->iommu_domain, cpu);
--
Quoted 2 lines

2.34.1

Applied for 6.12

Thanks
Christophe