From: Lukas Wunner Date: Sun, 26 Oct 2025 16:57:57 +0000 (+0100) Subject: PCI/PME: Replace RMW of Root Status register with direct write X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=699722468a0fca8b1b9ce1ffe2532171ddcaff95;p=thirdparty%2Fkernel%2Flinux.git PCI/PME: Replace RMW of Root Status register with direct write 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 Signed-off-by: Bjorn Helgaas Reviewed-by: Ilpo Järvinen Link: https://patch.msgid.link/39f87c99f6c44be3c0371c79e454e6fde7be0d4d.1761497583.git.lukas@wunner.de --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9fc4c2226b03..10ea5e7f4b34 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -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); } /**