Skip to content

Commit 600a5b4

Browse files
committed
PCI/ERR: Rename pci_aer_clear_device_status() to pcie_clear_device_status()
pci_aer_clear_device_status() clears the error bits in the PCIe Device Status Register (PCI_EXP_DEVSTA). Every PCIe device has this register, regardless of whether it supports AER. Rename pci_aer_clear_device_status() to pcie_clear_device_status() to make clear that it is PCIe-specific but not AER-specific. Move it to drivers/pci/pci.c, again since it's not AER-specific. No functional change intended. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent e83e2ca commit 600a5b4

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

drivers/pci/pci.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,6 +2046,14 @@ int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state)
20462046
}
20472047
EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state);
20482048

2049+
void pcie_clear_device_status(struct pci_dev *dev)
2050+
{
2051+
u16 sta;
2052+
2053+
pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta);
2054+
pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta);
2055+
}
2056+
20492057
/**
20502058
* pcie_clear_root_pme_status - Clear root port PME interrupt status.
20512059
* @dev: PCIe root port or event collector.

drivers/pci/pci.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ void pci_refresh_power_state(struct pci_dev *dev);
9292
int pci_power_up(struct pci_dev *dev);
9393
void pci_disable_enabled_device(struct pci_dev *dev);
9494
int pci_finish_runtime_suspend(struct pci_dev *dev);
95+
void pcie_clear_device_status(struct pci_dev *dev);
9596
void pcie_clear_root_pme_status(struct pci_dev *dev);
9697
bool pci_check_pme_status(struct pci_dev *dev);
9798
void pci_pme_wakeup_bus(struct pci_bus *bus);
@@ -658,15 +659,13 @@ void pci_aer_init(struct pci_dev *dev);
658659
void pci_aer_exit(struct pci_dev *dev);
659660
extern const struct attribute_group aer_stats_attr_group;
660661
void pci_aer_clear_fatal_status(struct pci_dev *dev);
661-
void pci_aer_clear_device_status(struct pci_dev *dev);
662662
int pci_aer_clear_status(struct pci_dev *dev);
663663
int pci_aer_raw_clear_status(struct pci_dev *dev);
664664
#else
665665
static inline void pci_no_aer(void) { }
666666
static inline void pci_aer_init(struct pci_dev *d) { }
667667
static inline void pci_aer_exit(struct pci_dev *d) { }
668668
static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { }
669-
static inline void pci_aer_clear_device_status(struct pci_dev *dev) { }
670669
static inline int pci_aer_clear_status(struct pci_dev *dev) { return -EINVAL; }
671670
static inline int pci_aer_raw_clear_status(struct pci_dev *dev) { return -EINVAL; }
672671
#endif

drivers/pci/pcie/aer.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,6 @@ int pci_disable_pcie_error_reporting(struct pci_dev *dev)
241241
}
242242
EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
243243

244-
void pci_aer_clear_device_status(struct pci_dev *dev)
245-
{
246-
u16 sta;
247-
248-
pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta);
249-
pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta);
250-
}
251-
252244
int pci_aer_clear_nonfatal_status(struct pci_dev *dev)
253245
{
254246
int aer = dev->aer_cap;
@@ -947,7 +939,7 @@ static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info)
947939
if (aer)
948940
pci_write_config_dword(dev, aer + PCI_ERR_COR_STATUS,
949941
info->status);
950-
pci_aer_clear_device_status(dev);
942+
pcie_clear_device_status(dev);
951943
} else if (info->severity == AER_NONFATAL)
952944
pcie_do_recovery(dev, pci_channel_io_normal, aer_root_reset);
953945
else if (info->severity == AER_FATAL)

drivers/pci/pcie/err.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
197197
pci_dbg(dev, "broadcast resume message\n");
198198
pci_walk_bus(bus, report_resume, &status);
199199

200-
pci_aer_clear_device_status(dev);
200+
pcie_clear_device_status(dev);
201201
pci_aer_clear_nonfatal_status(dev);
202202
pci_info(dev, "device recovery successful\n");
203203
return status;

0 commit comments

Comments
 (0)