]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
PCI: Protect Link Control 2 Register with RMW locking
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 18 Oct 2024 14:47:48 +0000 (17:47 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 23 Oct 2024 21:50:02 +0000 (16:50 -0500)
The PCIe Bandwidth Controller performs RMW accesses the Link Control 2
Register which can occur concurrently to other sources of Link Control 2
Register writes. Therefore, add Link Control 2 Register among the PCI
Express Capability Registers that need RMW locking.

Link: https://lore.kernel.org/r/20241018144755.7875-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Documentation/PCI/pciebus-howto.rst
include/linux/pci.h

index e48d01422efc201259105338d8539c4d1202f2e5..375d9ce171f62392205a671c8b5bc6b57246af59 100644 (file)
@@ -221,6 +221,7 @@ a selected set of PCI Express Capability Registers:
 
 * Link Control Register
 * Root Control Register
+* Link Control 2 Register
 
 Any change to those registers should be performed using RMW accessors to
 avoid problems due to concurrent updates. For the up-to-date list of
index 573b4c4c2be61f86338e753d97bc618a4dd25ccd..be5ed534c39cf70fe39c308ceb6d321c51b50744 100644 (file)
@@ -1274,6 +1274,7 @@ static inline int pcie_capability_clear_and_set_word(struct pci_dev *dev,
 {
        switch (pos) {
        case PCI_EXP_LNKCTL:
+       case PCI_EXP_LNKCTL2:
        case PCI_EXP_RTCTL:
                return pcie_capability_clear_and_set_word_locked(dev, pos,
                                                                 clear, set);