This is a note to let you know that I've just added the patch titled iommu/amd: Skip attach device domain is same as new domain to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: iommu-amd-skip-attach-device-domain-is-same-as-new-domain.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From f451c7a5a3b818ecfeba2ba258570769998baf3a Mon Sep 17 00:00:00 2001 From: Vasant Hegde <vasant.hegde@xxxxxxx> Date: Wed, 15 Feb 2023 05:26:41 +0000 Subject: iommu/amd: Skip attach device domain is same as new domain From: Vasant Hegde <vasant.hegde@xxxxxxx> commit f451c7a5a3b818ecfeba2ba258570769998baf3a upstream. If device->domain is same as new domain then we can skip the device attach process. Signed-off-by: Vasant Hegde <vasant.hegde@xxxxxxx> Link: https://lore.kernel.org/r/20230215052642.6016-2-vasant.hegde@xxxxxxx Signed-off-by: Joerg Roedel <jroedel@xxxxxxx> Cc: "Limonciello, Mario" <Mario.Limonciello@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/iommu/amd/iommu.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2161,6 +2161,13 @@ static int amd_iommu_attach_device(struc 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) Patches currently in stable-queue which might be from vasant.hegde@xxxxxxx are queue-6.2/iommu-attach-device-group-to-old-domain-in-error-path.patch queue-6.2/iommu-amd-improve-page-fault-error-reporting.patch queue-6.2/iommu-amd-fix-error-handling-for-pdev_pri_ats_enable.patch queue-6.2/iommu-amd-skip-attach-device-domain-is-same-as-new-domain.patch