Skip to content

Commit f3c3ccc

Browse files
jgunthorpebjorn-helgaas
authored andcommitted
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/0-v1-f96b686c625b+124-pci_acs_quirk_fix_jgg@nvidia.com Fixes: 47c8846 ("PCI: Extend ACS configurability") Reported-by: Jiri Slaby <jirislaby@kernel.org> Closes: https://lore.kernel.org/all/e89107da-ac99-4d3a-9527-a4df9986e120@kernel.org Closes: https://bugzilla.suse.com/show_bug.cgi?id=1229019 Tested-by: Steffen Dirkwinkel <me@steffen.cc> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 9852d85 commit f3c3ccc

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)