aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2021-11-05 11:28:42 -0500
committerBjorn Helgaas <bhelgaas@google.com>2021-11-05 11:28:42 -0500
commit1cac57a267c1692594413f27913adec85ba3b02a (patch)
treea53ec47abecf4b33d9dbe7c744f21de5b4fc7382 /drivers/pci
parentMerge branch 'pci/aspm' (diff)
parentPCI: Do not enable AtomicOps on VFs (diff)
downloadlinux-dev-1cac57a267c1692594413f27913adec85ba3b02a.tar.xz
linux-dev-1cac57a267c1692594413f27913adec85ba3b02a.zip
Merge branch 'pci/enumeration'
- Rename pcibios_add_device() to pcibios_device_add() since it's called from pci_device_add() (Oliver O'Halloran) - Don't try to enable AtomicOps on VFs, since they can only be enabled on the PF (Selvin Xavier) * pci/enumeration: PCI: Do not enable AtomicOps on VFs PCI: Rename pcibios_add_device() to pcibios_device_add()
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c12
-rw-r--r--drivers/pci/probe.c4
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 17e4341df0ff..3d98834ccc3a 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2116,14 +2116,14 @@ void pcim_pin_device(struct pci_dev *pdev)
EXPORT_SYMBOL(pcim_pin_device);
/*
- * pcibios_add_device - provide arch specific hooks when adding device dev
+ * pcibios_device_add - provide arch specific hooks when adding device dev
* @dev: the PCI device being added
*
* Permits the platform to provide architecture specific functionality when
* devices are added. This is the default implementation. Architecture
* implementations can override this.
*/
-int __weak pcibios_add_device(struct pci_dev *dev)
+int __weak pcibios_device_add(struct pci_dev *dev)
{
return 0;
}
@@ -3744,6 +3744,14 @@ int pci_enable_atomic_ops_to_root(struct pci_dev *dev, u32 cap_mask)
struct pci_dev *bridge;
u32 cap, ctl2;
+ /*
+ * Per PCIe r5.0, sec 9.3.5.10, the AtomicOp Requester Enable bit
+ * in Device Control 2 is reserved in VFs and the PF value applies
+ * to all associated VFs.
+ */
+ if (dev->is_virtfn)
+ return -EINVAL;
+
if (!pci_is_pcie(dev))
return -EINVAL;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 258350f80f6c..240e4cf8c83e 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2462,7 +2462,7 @@ static struct irq_domain *pci_dev_msi_domain(struct pci_dev *dev)
struct irq_domain *d;
/*
- * If a domain has been set through the pcibios_add_device()
+ * If a domain has been set through the pcibios_device_add()
* callback, then this is the one (platform code knows best).
*/
d = dev_get_msi_domain(&dev->dev);
@@ -2530,7 +2530,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
list_add_tail(&dev->bus_list, &bus->devices);
up_write(&pci_bus_sem);
- ret = pcibios_add_device(dev);
+ ret = pcibios_device_add(dev);
WARN_ON(ret < 0);
/* Set up MSI IRQ domain */