From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD03730BF4E; Mon, 13 Apr 2026 16:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098553; cv=none; b=DUmPuDLwKhwVE/3T6wEAJLEqpuKEEJR2xfeOoKW7jpMk5adjqQ6lW5X8uujOxWD7Unsou9ysk+4JVoweVLLIWJv8iwGR0SyixMsxRTVHDpeQI3++ZntErWXQx63qQwfwF5L9MIUKTrDlhHUzNMfkpoX7OrfhCL0j0ZfAcZbjaDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098553; c=relaxed/simple; bh=k82+4lM4lLHMqrFJTwbHNGDILbQpOrcf860nZjs7eZo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dDaXyds2n6WYDvjm3oa7YJGGzDbJ4R5e4E5u+Wi+r+XwHiNUPoNhbNL8/aboWDzY5jVmxtm40V3Cx//3FWuOwgjQ3ajw5oMcDtsb5CvHQPWhvjn6tYD1Taa3LYpZEEBdsuZWkP7xh1tFW1mQXLD0zUtOnPsADHbZUnsUrGzRtLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=de5WKc5M; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="de5WKc5M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5341DC2BCB0; Mon, 13 Apr 2026 16:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776098553; bh=k82+4lM4lLHMqrFJTwbHNGDILbQpOrcf860nZjs7eZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=de5WKc5MLRpStvOO+PMAO3w4KzVdPghgvKzg5Fx4141IO/emYoUq+3JkKeZWUQatm xi5Irt7fM4KCku0KODID5N+81JZstGcU5pL9rE4bE5+/pkqszuqdvAvijDRoWIc2HG EPquIcpQLu5uLvs6N70IcXABooXE2JB0BaO/9XO0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, John Hancock , bjorn.forsman@gmail.com, Linux kernel regressions list , Manivannan Sadhasivam Subject: [PATCH 5.15 569/570] Revert "PCI: Enable ACS after configuring IOMMU for OF platforms" Date: Mon, 13 Apr 2026 18:01:40 +0200 Message-ID: <20260413155851.793145415@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Manivannan Sadhasivam This reverts commit b20b659c2c6a072560b360feda81ae52176034df which is commit c41e2fb67e26b04d919257875fa954aa5f6e392e upstream. The original commit attempted to enable ACS in pci_dma_configure() prior to IOMMU group assignment in iommu_init_device() to fix the ACS enablement issue for OF platforms. But that assumption doesn't hold true for kernel versions prior to v6.15, because on these older kernels, pci_dma_configure() is called *after* iommu_init_device(). So the IOMMU groups are already created before the ACS gets enabled. This causes the devices that should have been split into separate groups by ACS, getting merged into one group, thereby breaking the IOMMU isolation as reported on the AMD machines. So revert the offending commit to restore the IOMMU group assignment on those affected machines. It should be noted that ACS has never really worked on kernel versions prior to v6.15, so the revert doesn't make any difference for OF platforms. Reported-by: John Hancock Reported-by: bjorn.forsman@gmail.com Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221234 Fixes: b20b659c2c6a ("PCI: Enable ACS after configuring IOMMU for OF platforms") Cc: Linux kernel regressions list Link: https://lore.kernel.org/regressions/2c30f181-ffc6-4d63-a64e-763cf4528f48@leemhuis.info Signed-off-by: Manivannan Sadhasivam Signed-off-by: Greg Kroah-Hartman --- drivers/pci/pci-driver.c | 8 -------- drivers/pci/pci.c | 10 +++++++++- drivers/pci/pci.h | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -1616,14 +1616,6 @@ static int pci_dma_configure(struct devi ret = acpi_dma_configure(dev, acpi_get_dma_attr(adev)); } - /* - * Attempt to enable ACS regardless of capability because some Root - * Ports (e.g. those quirked with *_intel_pch_acs_*) do not have - * the standard ACS capability but still support ACS via those - * quirks. - */ - pci_enable_acs(to_pci_dev(dev)); - pci_put_host_bridge_device(bridge); return ret; } --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -936,7 +936,7 @@ static void pci_std_enable_acs(struct pc * pci_enable_acs - enable ACS if hardware support it * @dev: the PCI device */ -void pci_enable_acs(struct pci_dev *dev) +static void pci_enable_acs(struct pci_dev *dev) { if (!pci_acs_enable) goto disable_acs_redir; @@ -3609,6 +3609,14 @@ bool pci_acs_path_enabled(struct pci_dev void pci_acs_init(struct pci_dev *dev) { dev->acs_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS); + + /* + * Attempt to enable ACS regardless of capability because some Root + * Ports (e.g. those quirked with *_intel_pch_acs_*) do not have + * the standard ACS capability but still support ACS via those + * quirks. + */ + pci_enable_acs(dev); } /** --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -562,7 +562,6 @@ static inline resource_size_t pci_resour } void pci_acs_init(struct pci_dev *dev); -void pci_enable_acs(struct pci_dev *dev); #ifdef CONFIG_PCI_QUIRKS int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); int pci_dev_specific_enable_acs(struct pci_dev *dev);