On Tue, Sep 29, 2026 at 12:47:26PM -0700, Kuppuswamy Sathyanarayanan wrote:
> On 9/27/2026 11:02 AM, Lukas Wunner wrote:
> > When firmware grants control of Advanced Error Reporting to the operating
> > system, that not only encompasses the AER capability, but also error
> > enable/status bits in the Device Control and Device Status registers
> > (PCI Firmware r3.3 table 4-6 bit 3).
> > 
> > PCIe devices without AER capability still support baseline capability
> > error reporting through these enable/status bits (PCIe r7.1 sec 6.2.1),
> > but the bits must not be modified unless AER control was granted.
> > 
> > pcie_aer_is_native() is unsuitable to check for control of AER-incapable
> > devices because it implicitly checks for presence of an AER capability.
> > 
> > Move that check to its callers (where needed) to allow using the function
> > for the imminent baseline capability error reporting.
> 
> Agreed that ownership and AER presence are separate questions, but
> changing the semantics while keeping the name may trip up callers that
> assume "native" implies "present".  Would a separate ownership-only
> helper (e.g. pcie_err_is_native()) be cleaner?  It could also replace
> cxl_error_is_native().

We usually use spec terms in the code to make it easier to connect the
code to the spec.  PCI Firmware r3.3 table 4-6 bit 3 uses the term
"PCI Express Advanced Error Reporting control", so pcie_aer_is_native()
seems apt.  I agree that it is a little non-obvious that it also
encompasses baseline error reporting control, but that's the way it is.

Thanks,

Lukas

Reply via email to