Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/iommu: Refactor spapr_tce_platform_iommu_attach_dev()

The patch makes the iommu_group_get() call only when using it
thereby avoiding the unnecessary get & put for domain already
being set case.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/170800513841.2411.13524607664262048895.stgit@linux.ibm.com

authored by

Shivaprasad G Bhat and committed by
Michael Ellerman
5bd31ab5 39cd87c4

+3 -4
+3 -4
arch/powerpc/kernel/iommu.c
··· 1285 1285 struct device *dev) 1286 1286 { 1287 1287 struct iommu_domain *domain = iommu_get_domain_for_dev(dev); 1288 - struct iommu_group *grp = iommu_group_get(dev); 1289 1288 struct iommu_table_group *table_group; 1289 + struct iommu_group *grp; 1290 1290 1291 1291 /* At first attach the ownership is already set */ 1292 - if (!domain) { 1293 - iommu_group_put(grp); 1292 + if (!domain) 1294 1293 return 0; 1295 - } 1296 1294 1295 + grp = iommu_group_get(dev); 1297 1296 table_group = iommu_group_get_iommudata(grp); 1298 1297 /* 1299 1298 * The domain being set to PLATFORM from earlier