Some PCIe devices do not have AER capabilities, but they have device status registers. The PCIe device status register and AER register are independent PCIe capabilities, so it is unreasonable to use CONFIG_PCIEAER for compilation control of pcie_clear_device_status(), although which is currently only used in the "aer.c", "edr.c", and "err.c". Some operating system configurations do not enable the AER feature, but still expect to use the device status register for simple RAS. In this case, pcie_clear_device_status() can be used to clear the device status regs, so this patch can meet the requirements of this scenario. Signed-off-by: Songyang Li <leesongyang@xxxxxxxxxxx> --- drivers/pci/pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/pci/pci.c diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c old mode 100644 new mode 100755 index 35fb1f17a589..e6de55be4c45 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2263,7 +2263,12 @@ int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state) } EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); -#ifdef CONFIG_PCIEAER +/** + * pcie_clear_device_status - Clear device status. + * @dev: the PCI device. + * + * Clear the device status for the PCI device. + */ void pcie_clear_device_status(struct pci_dev *dev) { u16 sta; @@ -2271,7 +2276,6 @@ void pcie_clear_device_status(struct pci_dev *dev) pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta); pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta); } -#endif /** * pcie_clear_root_pme_status - Clear root port PME interrupt status. -- 2.34.1