* [PATCH 1/1] soc/fsl/qbman: Use iommu_paging_domain_alloc()
@ 2024-08-12 7:25 Lu Baolu
2024-09-03 8:45 ` Christophe Leroy
0 siblings, 1 reply; 2+ messages in thread
From: Lu Baolu @ 2024-08-12 7:25 UTC (permalink / raw)
To: Christophe Leroy, Joerg Roedel, Will Deacon, Robin Murphy,
Jason Gunthorpe, Kevin Tian
Cc: linuxppc-dev, linux-arm-kernel, iommu, linux-kernel, Lu Baolu,
Jason Gunthorpe
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.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240610085555.88197-14-baolu.lu@linux.intel.com
---
drivers/soc/fsl/qbman/qman_portal.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
index e23b60618c1a..456ef5d5c199 100644
--- a/drivers/soc/fsl/qbman/qman_portal.c
+++ b/drivers/soc/fsl/qbman/qman_portal.c
@@ -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);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] soc/fsl/qbman: Use iommu_paging_domain_alloc()
2024-08-12 7:25 [PATCH 1/1] soc/fsl/qbman: Use iommu_paging_domain_alloc() Lu Baolu
@ 2024-09-03 8:45 ` Christophe Leroy
0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy @ 2024-09-03 8:45 UTC (permalink / raw)
To: Lu Baolu, Joerg Roedel, Will Deacon, Robin Murphy,
Jason Gunthorpe, Kevin Tian
Cc: linuxppc-dev, linux-arm-kernel, iommu, linux-kernel,
Jason Gunthorpe
Le 12/08/2024 à 09:25, Lu Baolu a écrit :
> [Vous ne recevez pas souvent de courriers de baolu.lu@linux.intel.com. 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.
>
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Link: https://lore.kernel.org/r/20240610085555.88197-14-baolu.lu@linux.intel.com
> ---
> drivers/soc/fsl/qbman/qman_portal.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
> index e23b60618c1a..456ef5d5c199 100644
> --- a/drivers/soc/fsl/qbman/qman_portal.c
> +++ b/drivers/soc/fsl/qbman/qman_portal.c
> @@ -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);
> --
> 2.34.1
>
Applied for 6.12
Thanks
Christophe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-03 8:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 7:25 [PATCH 1/1] soc/fsl/qbman: Use iommu_paging_domain_alloc() Lu Baolu
2024-09-03 8:45 ` Christophe Leroy
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).