Re: [PATCH v19 02/14] cxl/ras: Fix cxl_rch_get_aer_severity() wrong severity register

Lukas Wunner <[email protected]>
Newsgroups org.kernel.vger.linux-cxl,org.kernel.vger.linux-acpi,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <[email protected]>
On Mon, Aug 03, 2026 at 05:17:58PM -0500, Terry Bowman wrote:
> +++ b/drivers/cxl/core/ras_rch.c
> @@ -94,11 +94,11 @@ static bool cxl_rch_get_aer_info(void __iomem *aer_base,
>  static bool cxl_rch_get_aer_severity(struct aer_capability_regs *aer_regs,
>  				     int *severity)
>  {
> -	if (aer_regs->uncor_status & ~aer_regs->uncor_mask) {
> -		if (aer_regs->uncor_status & PCI_ERR_ROOT_FATAL_RCV)
> -			*severity = AER_FATAL;
> -		else
> -			*severity = AER_NONFATAL;
> +	u32 uncor_status = aer_regs->uncor_status & ~aer_regs->uncor_mask;
> +
> +	if (uncor_status) {
> +		*severity = (uncor_status & aer_regs->uncor_severity) ?
> +			     AER_FATAL : AER_NONFATAL;
>  		return true;
>  	}
>  

Independently of this patch, I'm wondering why the severity is inferred
from the AER registers.  I would assume that the severity always equals
the message received by the RCEC (ERR_COR, ERR_NONFATAL or ERR_FATAL).

So the severity could be passed to cxl_handle_rdport_errors() from its
callers:  cxl_cor_err_detected() would pass AER_CORRECTABLE and
cxl_error_detected() would pass ERR_NONFATAL or ERR_FATAL (depending
on the "state" variable).

cxl_handle_rdport_errors() would no longer need to call
cxl_rch_get_aer_severity(), so the latter could be removed.

Am I missing something?  Is a scenario ever conceivable where the RCEC
receives a message with different severity than what is inferred from
the registers by cxl_rch_get_aer_severity()?

And a related question:  linux-next commit 21963e6e4e04 ("PCI/AER:
Support Advisory Non-Fatal Errors") enables support for Non-Fatal
Errors which are signaled with an ERR_COR message.

These so-called Advisory Non-Fatal Errors set one bit in the Correctable
Error Status Register (Advisory Non-Fatal Error Status, bit 13) and
additionally one or more bits in the Uncorrectable Error Status Register
(see the commit for details).

cxl_rch_get_aer_severity() is not able to cope with such errors and
will incorrectly infer that the severity is AER_NONFATAL.

Now I *think* this is not a problem because Advisory Non-Fatal Errors
are masked by default and the commit only unmasks them on regular PCI
devices, not in the RCRB of a CXL device.  Only once bit 13 in the
Correctable Error Mask Register is cleared in the RCRB will
cxl_rch_get_aer_severity() fail.  Right?

Thanks,

Lukas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.