Skip to content

Commit 04af8a3

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: Protect Link Control 2 Register with RMW locking
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/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Lukas Wunner <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]>
1 parent fad610b commit 04af8a3

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Documentation/PCI/pciebus-howto.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ a selected set of PCI Express Capability Registers:
221221

222222
* Link Control Register
223223
* Root Control Register
224+
* Link Control 2 Register
224225

225226
Any change to those registers should be performed using RMW accessors to
226227
avoid problems due to concurrent updates. For the up-to-date list of

include/linux/pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@ static inline int pcie_capability_clear_and_set_word(struct pci_dev *dev,
12741274
{
12751275
switch (pos) {
12761276
case PCI_EXP_LNKCTL:
1277+
case PCI_EXP_LNKCTL2:
12771278
case PCI_EXP_RTCTL:
12781279
return pcie_capability_clear_and_set_word_locked(dev, pos,
12791280
clear, set);

0 commit comments

Comments
 (0)