Commit 05b92660 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 269ce3bd f3c3ccc4
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -1067,8 +1067,15 @@ static void pci_std_enable_acs(struct pci_dev *dev, struct pci_acs *caps)
static void pci_enable_acs(struct pci_dev *dev)
{
	struct pci_acs caps;
	bool enable_acs = false;
	int pos;

	/* If an iommu is present we start with kernel default caps */
	if (pci_acs_enable) {
		if (pci_dev_specific_enable_acs(dev))
			enable_acs = true;
	}

	pos = dev->acs_cap;
	if (!pos)
		return;
@@ -1077,11 +1084,8 @@ static void pci_enable_acs(struct pci_dev *dev)
	pci_read_config_word(dev, pos + PCI_ACS_CTRL, &caps.ctrl);
	caps.fw_ctrl = caps.ctrl;

	/* If an iommu is present we start with kernel default caps */
	if (pci_acs_enable) {
		if (pci_dev_specific_enable_acs(dev))
	if (enable_acs)
		pci_std_enable_acs(dev, &caps);
	}

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