Skip to content

Commit e5d5034

Browse files
author
Myron Stowe
committed
PCI: Fix pci_enable_acs() support for the ACS quirks
JIRA: https://issues.redhat.com/browse/RHEL-67693 Upstream Status: f3c3ccc commit f3c3ccc Author: Jason Gunthorpe <[email protected]> Date: Wed Oct 16 20:52:33 2024 -0300 PCI: Fix pci_enable_acs() support for the ACS quirks There are ACS quirks that hijack the normal ACS processing and deliver to to special quirk code. The enable path needs to call pci_dev_specific_enable_acs() and then pci_dev_specific_acs_enabled() will report the hidden ACS state controlled by the quirk. The recent rework got this out of order and we should try to call pci_dev_specific_enable_acs() regardless of any actual ACS support in the device. As before command line parameters that effect standard PCI ACS don't interact with the quirk versions, including the new config_acs= option. Link: https://lore.kernel.org/r/[email protected] Fixes: 47c8846 ("PCI: Extend ACS configurability") Reported-by: Jiri Slaby <[email protected]> Closes: https://lore.kernel.org/all/[email protected] Closes: https://bugzilla.suse.com/show_bug.cgi?id=1229019 Tested-by: Steffen Dirkwinkel <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Signed-off-by: Myron Stowe <[email protected]>
1 parent e4b3850 commit e5d5034

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

drivers/pci/pci.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,15 @@ static void pci_std_enable_acs(struct pci_dev *dev, struct pci_acs *caps)
10671067
static void pci_enable_acs(struct pci_dev *dev)
10681068
{
10691069
struct pci_acs caps;
1070+
bool enable_acs = false;
10701071
int pos;
10711072

1073+
/* If an iommu is present we start with kernel default caps */
1074+
if (pci_acs_enable) {
1075+
if (pci_dev_specific_enable_acs(dev))
1076+
enable_acs = true;
1077+
}
1078+
10721079
pos = dev->acs_cap;
10731080
if (!pos)
10741081
return;
@@ -1077,11 +1084,8 @@ static void pci_enable_acs(struct pci_dev *dev)
10771084
pci_read_config_word(dev, pos + PCI_ACS_CTRL, &caps.ctrl);
10781085
caps.fw_ctrl = caps.ctrl;
10791086

1080-
/* If an iommu is present we start with kernel default caps */
1081-
if (pci_acs_enable) {
1082-
if (pci_dev_specific_enable_acs(dev))
1083-
pci_std_enable_acs(dev, &caps);
1084-
}
1087+
if (enable_acs)
1088+
pci_std_enable_acs(dev, &caps);
10851089

10861090
/*
10871091
* Always apply caps from the command line, even if there is no iommu.

0 commit comments

Comments
 (0)