projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
996d120
)
iommu/amd: Skip attach device domain is same as new domain
author
Vasant Hegde
<vasant.hegde@amd.com>
Wed, 15 Feb 2023 05:26:41 +0000
(
05:26
+0000)
committer
Joerg Roedel
<jroedel@suse.de>
Sat, 18 Feb 2023 14:36:33 +0000
(15:36 +0100)
If device->domain is same as new domain then we can skip the
device attach process.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Link:
https://lore.kernel.org/r/20230215052642.6016-2-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/iommu.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/amd/iommu.c
b/drivers/iommu/amd/iommu.c
index f97c0bf930a7f3b53cc2e7ccfaca6c4b79d606d4..2aff392d98955592b2e273936b2201c0234a8c04 100644
(file)
--- a/
drivers/iommu/amd/iommu.c
+++ b/
drivers/iommu/amd/iommu.c
@@
-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)