Re: [PATCH v14 10/34] PCI/AER: Update is_internal_error() to be non-static is_aer_internal_error()
From: dan.j.williams
Date: Thu Jan 15 2026 - 15:42:42 EST
Jonathan Cameron wrote:
> On Wed, 14 Jan 2026 12:20:31 -0600
> Terry Bowman <terry.bowman@xxxxxxx> wrote:
>
> > 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 other PCI drivers to access.
> >
> > Signed-off-by: Terry Bowman <terry.bowman@xxxxxxx>
> Hi Terry,
>
> I don't see it as sensible to have is_aer_internal_error()
> return false if CXL is not built. That question has nothing to
> do with CXL. Hence if we are doing generic naming, I think we
> should just always have the function available. Gating on CXL
> belongs at whatever called it. Which is the case already for
> cxl_rch_handle_error() which has a stub that doesn't call this for
> when CXL stuff isn't built.
>
> Should just be a case of moving out of if the ifdef in aer.c
> as part of this patch.
I agree with the general sentiment, but not the conclusion, especially
because this is a private detail. Linux has long ignored internal
errors. The only reason to consider them now is because CXL decided to
multiplex its error model on top of this oft-ignored feature of PCIe
AER.
Specifically, portdrv.h is not in the global include namespace, this is
a private detail of the only conumer of internal errors:
drivers/pci/pcie/aer_cxl_{rch,vh}.c
At most we should have this as a comment to clarify:
/*
* Note, internal errors are only considered for the CXL error model,
* not for other implementations.
*/
...and the pci_aer_unmask_internal_errors() export should be:
EXPORT_SYMBOL_FOR_MODULES(pci_aer_unmask_internal_errors, "cxl_core")
...for the same reason. Steer folks away from thinking that it is open
season for adding more internal error support.