[PATCH 14/15] cxl/aer/pci: Export pci_aer_unmask_internal_errors()

Terry Bowman posted 15 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH 14/15] cxl/aer/pci: Export pci_aer_unmask_internal_errors()
Posted by Terry Bowman 1 month, 2 weeks ago
The CXL driver needs to enable AER correctable and uncorrectable internal
errors in order to receive notification of protocol
errors. pci_aer_unmask_internal_errors() is currently defined as
'static' in the AER service driver.

Update the AER service driver, exporting pci_aer_unmask_internal_errors()
to CXL namespace.

Signed-off-by: Terry Bowman <terry.bowman@amd.com>
---
 drivers/pci/pcie/aer.c | 6 ++++--
 include/linux/aer.h    | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 81a19028c4e7..1b4004932084 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -962,7 +962,6 @@ static bool is_internal_error(struct aer_err_info *info)
 	return info->status & PCI_ERR_UNC_INTN;
 }
 
-#ifdef CONFIG_PCIEAER_CXL
 /**
  * pci_aer_unmask_internal_errors - unmask internal errors
  * @dev: pointer to the pcie_dev data structure
@@ -973,7 +972,7 @@ static bool is_internal_error(struct aer_err_info *info)
  * Note: AER must be enabled and supported by the device which must be
  * checked in advance, e.g. with pcie_aer_is_native().
  */
-static void pci_aer_unmask_internal_errors(struct pci_dev *dev)
+void pci_aer_unmask_internal_errors(struct pci_dev *dev)
 {
 	int aer = dev->aer_cap;
 	u32 mask;
@@ -986,6 +985,9 @@ static void pci_aer_unmask_internal_errors(struct pci_dev *dev)
 	mask &= ~PCI_ERR_COR_INTERNAL;
 	pci_write_config_dword(dev, aer + PCI_ERR_COR_MASK, mask);
 }
+EXPORT_SYMBOL_NS_GPL(pci_aer_unmask_internal_errors, CXL);
+
+#ifdef CONFIG_PCIEAER_CXL
 
 static bool is_cxl_mem_dev(struct pci_dev *dev)
 {
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 67fd04c5ae2b..c43d2b60b992 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -69,5 +69,7 @@ struct cxl_port_err_hndlrs {
 void register_cxl_port_hndlrs(struct cxl_port_err_hndlrs *_cxl_port_hndlrs);
 void unregister_cxl_port_hndlrs(void);
 struct cxl_port_err_hndlrs *find_cxl_port_hndlrs(void);
+
+void pci_aer_unmask_internal_errors(struct pci_dev *dev);
 #endif //_AER_H_
 
-- 
2.34.1
Re: [PATCH 14/15] cxl/aer/pci: Export pci_aer_unmask_internal_errors()
Posted by Jonathan Cameron 1 month, 1 week ago
On Tue, 8 Oct 2024 17:16:56 -0500
Terry Bowman <terry.bowman@amd.com> wrote:

> The CXL driver needs to enable AER correctable and uncorrectable internal
> errors in order to receive notification of protocol
> errors. pci_aer_unmask_internal_errors() is currently defined as
> 'static' in the AER service driver.
> 
> Update the AER service driver, exporting pci_aer_unmask_internal_errors()
> to CXL namespace.
> 
> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

(subject to suggestion we just enable internal errors for all devices
and sit back and watch for error reports :))