]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI/PME: Replace RMW of Root Status register with direct write
authorLukas Wunner <lukas@wunner.de>
Sun, 26 Oct 2025 16:57:57 +0000 (17:57 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 6 Feb 2026 22:40:33 +0000 (16:40 -0600)
As of PCIe r7.0, the Root Status register contains a single writeable bit
(PME Status, type RW1C) and otherwise just read-only bits and RsvdZ bits
(which software must write as zero, PCIe r7.0 sec 7.4).

Thus, when clearing the PME Status bit, there's no need to perform a
read-modify-write of the register.  Instead, the bit can be written
directly.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/39f87c99f6c44be3c0371c79e454e6fde7be0d4d.1761497583.git.lukas@wunner.de
drivers/pci/pci.c

index 9fc4c2226b0371ab628e22a56e3a947810e86dbb..10ea5e7f4b34a6557888837f8317f0387687b083 100644 (file)
@@ -2256,7 +2256,7 @@ void pcie_clear_device_status(struct pci_dev *dev)
  */
 void pcie_clear_root_pme_status(struct pci_dev *dev)
 {
-       pcie_capability_set_dword(dev, PCI_EXP_RTSTA, PCI_EXP_RTSTA_PME);
+       pcie_capability_write_dword(dev, PCI_EXP_RTSTA, PCI_EXP_RTSTA_PME);
 }
 
 /**