Skip to content

Commit 05b9266

Browse files
committed
Merge tag 'pci-v6.12-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
Pull pci fix from Bjorn Helgaas: - Enable device-specific ACS-like functionality even if the device doesn't advertise an ACS capability, which got broken when adding fancy ACS kernel parameter (Jason Gunthorpe) * tag 'pci-v6.12-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: PCI: Fix pci_enable_acs() support for the ACS quirks
2 parents 269ce3b + f3c3ccc commit 05b9266

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)