]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI/AER: Update is_internal_error() to be non-static is_aer_internal_error()
authorTerry Bowman <terry.bowman@amd.com>
Wed, 14 Jan 2026 18:20:31 +0000 (12:20 -0600)
committerDave Jiang <dave.jiang@intel.com>
Thu, 22 Jan 2026 22:07:04 +0000 (15:07 -0700)
The AER driver includes significant logic for handling CXL protocol errors.
The AER driver will be updated in the future to separate the AER and CXL
logic.

Rename the is_internal_error() function to is_aer_internal_error() as it
gives a more precise indication of the purpose. Make
is_aer_internal_error() non-static to allow for the 2 different CXL
topology error model implementations (RCH and VH) to share this helper.

Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Link: https://patch.msgid.link/20260114182055.46029-11-terry.bowman@amd.com
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/pci/pcie/aer.c
drivers/pci/pcie/portdrv.h

index 972ecaf6a8321ee01fbfd6aa96156fe518bd0b84..6943a75e6a78766713ab86b7fbc2c024398b016d 100644 (file)
@@ -1171,7 +1171,7 @@ static bool is_cxl_mem_dev(struct pci_dev *dev)
        return true;
 }
 
-static bool is_internal_error(struct aer_err_info *info)
+bool is_aer_internal_error(struct aer_err_info *info)
 {
        if (info->severity == AER_CORRECTABLE)
                return info->status & PCI_ERR_COR_INTERNAL;
@@ -1216,7 +1216,7 @@ static void cxl_rch_handle_error(struct pci_dev *dev, struct aer_err_info *info)
         * device driver.
         */
        if (pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC &&
-           is_internal_error(info))
+           is_aer_internal_error(info))
                pcie_walk_rcec(dev, cxl_rch_handle_error_iter, info);
 }
 
index bd29d1cc7b8bd75fc14cb0cbfe44e50a8ddfcffd..e7a0a2cffea9342c4b2a97db152f96bd3f6e9f52 100644 (file)
@@ -123,4 +123,13 @@ static inline void pcie_pme_interrupt_enable(struct pci_dev *dev, bool en) {}
 #endif /* !CONFIG_PCIE_PME */
 
 struct device *pcie_port_find_device(struct pci_dev *dev, u32 service);
+
+struct aer_err_info;
+
+#ifdef CONFIG_PCIEAER_CXL
+bool is_aer_internal_error(struct aer_err_info *info);
+#else
+static inline bool is_aer_internal_error(struct aer_err_info *info) { return false; }
+#endif /* CONFIG_PCIEAER_CXL */
+
 #endif /* _PORTDRV_H_ */