[PATCH] iommu/amd: Enable PCIe ACS once AMD IOMMU initialization succeeds

Jinhui Guo posted 1 patch 3 days, 13 hours ago
drivers/iommu/amd/init.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[PATCH] iommu/amd: Enable PCIe ACS once AMD IOMMU initialization succeeds
Posted by Jinhui Guo 3 days, 13 hours ago
Enable PCIe ACS after the AMD IOMMU has been initialized
successfully.

Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
---
 drivers/iommu/amd/init.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index ba9e582a8bbe..b695efc54d5b 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -3212,9 +3212,6 @@ static bool __init detect_ivrs(void)
 	}
 
 out:
-	/* Make sure ACS will be enabled during PCI probe */
-	pci_request_acs();
-
 	return true;
 }
 
@@ -3284,6 +3281,10 @@ static int __init state_next(void)
 			ret = -EINVAL;
 		} else {
 			ret = early_amd_iommu_init();
+			if (!ret) {
+				/* Make sure ACS will be enabled during PCI probe */
+				pci_request_acs();
+			}
 			init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
 		}
 		break;
-- 
2.20.1
[PATCH] iommu/amd: Enable PCIe ACS once AMD IOMMU initialization succeeds
Posted by Jinhui Guo 3 days, 13 hours ago
Date: Sun, 28 Sep 2025 14:58:17 +0800, Jinhui Guo wrote:
>@@ -3212,9 +3212,6 @@ static bool __init detect_ivrs(void)
> 	}
> 
>out:
>-	/* Make sure ACS will be enabled during PCI probe */
>-	pci_request_acs();
>-
>	return true;
>}
> 
>@@ -3284,6 +3281,10 @@ static int __init state_next(void)
> 			ret = -EINVAL;
> 		} else {
> 			ret = early_amd_iommu_init();
>+			if (!ret) {
>+				/* Make sure ACS will be enabled during PCI probe */
>+				pci_request_acs();
>+			}
> 			init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
> 		}
> 		break;

Please discard this patch. It breaks when interrupt remapping is off.