Skip to content

Commit f451c7a

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Skip attach device domain is same as new domain
If device->domain is same as new domain then we can skip the device attach process. Signed-off-by: Vasant Hegde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 996d120 commit f451c7a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/iommu/amd/iommu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,6 +2184,13 @@ static int amd_iommu_attach_device(struct iommu_domain *dom,
21842184
struct amd_iommu *iommu = rlookup_amd_iommu(dev);
21852185
int ret;
21862186

2187+
/*
2188+
* Skip attach device to domain if new domain is same as
2189+
* devices current domain
2190+
*/
2191+
if (dev_data->domain == domain)
2192+
return 0;
2193+
21872194
dev_data->defer_attach = false;
21882195

21892196
if (dev_data->domain)

0 commit comments

Comments
 (0)