Message ID | 170800513841.2411.13524607664262048895.stgit@linux.ibm.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 5bd31ab5f79eb6e3bdfa0ca0b57650f9d1604062 |
Headers | show |
Series | powerpc/iommu: Refactor spapr_tce_platform_iommu_attach_dev() | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/github-powerpc_ppctests | success | Successfully ran 8 jobs. |
snowpatch_ozlabs/github-powerpc_selftests | success | Successfully ran 8 jobs. |
snowpatch_ozlabs/github-powerpc_sparse | success | Successfully ran 4 jobs. |
snowpatch_ozlabs/github-powerpc_clang | success | Successfully ran 6 jobs. |
snowpatch_ozlabs/github-powerpc_kernel_qemu | success | Successfully ran 23 jobs. |
On Thu, 15 Feb 2024 07:52:32 -0600, Shivaprasad G Bhat wrote: > The patch makes the iommu_group_get() call only when using it > thereby avoiding the unnecessary get & put for domain already > being set case. > > Applied to powerpc/fixes. [1/1] powerpc/iommu: Refactor spapr_tce_platform_iommu_attach_dev() https://git.kernel.org/powerpc/c/5bd31ab5f79eb6e3bdfa0ca0b57650f9d1604062 cheers
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index a9bebfd56b3b..37fae3bd89c6 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -1285,15 +1285,14 @@ spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain, struct device *dev) { struct iommu_domain *domain = iommu_get_domain_for_dev(dev); - struct iommu_group *grp = iommu_group_get(dev); struct iommu_table_group *table_group; + struct iommu_group *grp; /* At first attach the ownership is already set */ - if (!domain) { - iommu_group_put(grp); + if (!domain) return 0; - } + grp = iommu_group_get(dev); table_group = iommu_group_get_iommudata(grp); /* * The domain being set to PLATFORM from earlier