Skip to contentSkip to conversation

cxl: Remove ifdef blocks of CONFIG_PCIEAER_CXL from core/pci.c

PATCH Superseded Dave Jiang 2 participants 2 messages Jul 18, 2025 CXL

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Dave Jiang

author maintainer
#0 lore raw

PATCH 1/1 cxl: Remove ifdef blocks of CONFIG_PCIEAER_CXL from core/pci.c

Remove from core/pci_aer.c and move the CONFIG_PCIEAER_CXL ifdef to cxlpci.h to deal with the exported symbols as needed. There is enough AER handling code (and more to come) to move the AER code to its own C file.

Cc Robert Richter <[email protected]>
Cc Terry Bowman <[email protected]>
---
 drivers/cxl/core/Makefile  |   1 +
 drivers/cxl/core/core.h    |   4 +
 drivers/cxl/core/pci.c     | 171 +------------------------------------
 drivers/cxl/core/pci_aer.c | 168 ++++++++++++++++++++++++++++++++++++
 drivers/cxl/cxl.h          |   8 --
 drivers/cxl/cxlpci.h       |   8 ++
 tools/testing/cxl/Kbuild   |   1 +
 7 files changed, 184 insertions(+), 177 deletions(-)
 create mode 100644 drivers/cxl/core/pci_aer.c
drivers/cxl/core/Makefile +1 -0
index 79e2ef81fde8..bcea856157af 100644
@@ -21,3 +21,4 @@ cxl_core-$(CONFIG_CXL_REGION) += region.o
 cxl_core-$(CONFIG_CXL_MCE) += mce.o
 cxl_core-$(CONFIG_CXL_FEATURES) += features.o
 cxl_core-$(CONFIG_CXL_EDAC_MEM_FEATURES) += edac.o
+cxl_core-$(CONFIG_PCIEAER_CXL) += pci_aer.o
drivers/cxl/core/core.h +4 -0
index 29b61828a847..6ac8cd3cc16d 100644
@@ -136,4 +136,8 @@ int cxl_set_feature(struct cxl_mailbox *cxl_mbox, const uuid_t *feat_uuid,
 		    u16 *return_code);
 #endif
 
+void cxl_handle_rdport_errors(struct cxl_dev_state *cxlds);
+void __cxl_handle_cor_ras(struct cxl_dev_state *cxlds, void __iomem *ras_base);
+bool __cxl_handle_ras(struct cxl_dev_state *cxlds, void __iomem *ras_base);
+
 #endif /* __CXL_CORE_H__ */
drivers/cxl/core/pci.c +2 -169

189 lines not on this page · raw message

drivers/cxl/core/pci_aer.c new file +168 -0

168 lines not on this page · raw message

drivers/cxl/cxl.h +0 -8
index 3f1695c96abc..73397da7f970 100644
@@ -759,14 +759,6 @@ struct cxl_dport *devm_cxl_add_rch_dport(struct cxl_port *port,
 					 struct device *dport_dev, int port_id,
 					 resource_size_t rcrb);
 
-#ifdef CONFIG_PCIEAER_CXL
-void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport);
-void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host);
-#else
-static inline void cxl_dport_init_ras_reporting(struct cxl_dport *dport,
-						struct device *host) { }
-#endif
-
 struct cxl_decoder *to_cxl_decoder(struct device *dev);
 struct cxl_root_decoder *to_cxl_root_decoder(struct device *dev);
 struct cxl_switch_decoder *to_cxl_switch_decoder(struct device *dev);
drivers/cxl/cxlpci.h +8 -0
index 54e219b0049e..5f73ce42a758 100644
@@ -135,4 +135,12 @@ void read_cdat_data(struct cxl_port *port);
 void cxl_cor_error_detected(struct pci_dev *pdev);
 pci_ers_result_t cxl_error_detected(struct pci_dev *pdev,
 				    pci_channel_state_t state);
+
+#ifdef CONFIG_PCIEAER_CXL
+void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host);
+#else
+static inline void cxl_dport_init_ras_reporting(struct cxl_dport *dport,
+						struct device *host) { }
+#endif
+
 #endif /* __CXL_PCI_H__ */
tools/testing/cxl/Kbuild +1 -0
index 31a2d73c963f..54b49d8e6b40 100644
@@ -68,6 +68,7 @@ cxl_core-$(CONFIG_CXL_REGION) += $(CXL_CORE_SRC)/region.o
 cxl_core-$(CONFIG_CXL_MCE) += $(CXL_CORE_SRC)/mce.o
 cxl_core-$(CONFIG_CXL_FEATURES) += $(CXL_CORE_SRC)/features.o
 cxl_core-$(CONFIG_CXL_EDAC_MEM_FEATURES) += $(CXL_CORE_SRC)/edac.o
+cxl_core-$(CONFIG_PCIEAER_CXL) += $(CXL_CORE_SRC)/pci_aer.o
 cxl_core-y += config_check.o
 cxl_core-y += cxl_core_test.o
 cxl_core-y += cxl_core_exports.o

base-commit: 347e9f5043c89695b01e66b3ed111755afcf1911

Signature · 1 line
2.50.1
#1 lore raw
kernel test robot noticed the following build errors:

Hi Dave,

kernel test robot noticed the following build errors:

[auto build test ERROR on 347e9f5043c89695b01e66b3ed111755afcf1911]

url:    https://github.com/intel-lab-lkp/linux/commits/Dave-Jiang/cxl-Remove-ifdef-blocks-of-CONFIG_PCIEAER_CXL-from-core-pci-c/20250719-052711
base:   347e9f5043c89695b01e66b3ed111755afcf1911
patch link:    https://lore.kernel.org/r/20250718212452.2100663-1-dave.jiang%40intel.com
patch subject: [PATCH] cxl: Remove ifdef blocks of CONFIG_PCIEAER_CXL from core/pci.c
config: riscv-randconfig-001-20250719 (https://download.01.org/0day-ci/archive/20250719/[email protected]/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 16534d19bf50bde879a83f0ae62875e2c5120e64)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250719/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> ERROR: modpost: "cxl_handle_rdport_errors" [drivers/cxl/core/cxl_core.ko] undefined!
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki