Commit f451c7a5 authored by Vasant Hegde's avatar Vasant Hegde Committed by Joerg Roedel
Browse files

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: default avatarVasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20230215052642.6016-2-vasant.hegde@amd.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 996d120b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2184,6 +2184,13 @@ static int amd_iommu_attach_device(struct iommu_domain *dom,
	struct amd_iommu *iommu = rlookup_amd_iommu(dev);
	int ret;

	/*
	 * Skip attach device to domain if new domain is same as
	 * devices current domain
	 */
	if (dev_data->domain == domain)
		return 0;

	dev_data->defer_attach = false;

	if (dev_data->domain)