diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 458a52d6fd2f79a5e75e34345341ac833e80af15..8ace56c8141b08df39f191cc49891022495fe078 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3674,6 +3674,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;