Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Raag Jadav <raag.jadav@intel.com>,
	Riana Tauro <riana.tauro@intel.com>,
	Yury Murashka <yurypm@arista.com>,
	Matthew W Carlis <mattc@purestorage.com>,
	linux-pci@vger.kernel.org,
	Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
	Oliver OHalloran <oohall@gmail.com>,
	linuxppc-dev@lists.ozlabs.org,
	Aravind Iddamsetty <aravind.iddamsetty@intel.com>,
	Srinivasa Adatrao <srinivasa.adatrao@intel.com>,
	Terry Bowman <terry.bowman@amd.com>,
	Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH 7/7] PCI/AER: Enable baseline capability error reporting
Date: Thu, 1 Oct 2026 10:44:27 -0700	[thread overview]
Message-ID: <faf9a756-2682-49f7-a6a1-2a46515f773d@linux.intel.com> (raw)
In-Reply-To: <ary1aMGD-hqf78L9@wunner.de>

Hi Lukas,

On 9/30/2026 12:08 AM, Lukas Wunner wrote:
> On Tue, Sep 29, 2026 at 02:01:42PM -0700, Kuppuswamy Sathyanarayanan wrote:
>> On 9/27/2026 11:02 AM, Lukas Wunner wrote:
>>> @@ -431,6 +432,9 @@ void pci_aer_init(struct pci_dev *dev)
>>>  					       PCI_ERR_COR_ADV_NFAT, 0);
>>>  
>>>  	pci_aer_clear_status(dev);
>>> +enable:
>>> +	if (pcie_aer_is_native(dev))
>>> +		pcie_clear_device_status(dev);
>>>  
>>>  	if (pci_aer_available())
>>>  		pci_enable_pcie_error_reporting(dev);
>>
>> This also enables error reporting below AER-incapable Root Ports, where
>> no AER service handles the ERR_* Messages.  The Root Control System
>> Error enable bits are only cleared by aer_enable_rootport(), which
>> doesn't run on such ports.  If firmware left them set, the newly
>> enabled Messages could result in System Errors.
>>
>> Should reporting be enabled only if an AER service (or DPC) is above
>> the device?
> 
> Excellent observation.  This is a pre-existing issue but I think you're
> right.  However it's non-trivial to fix because just checking for DPC
> capability in the ancestry or AER capability at the Root Port isn't
> sufficient:
> 
> For RCiEPs, we'd need to check whether an RCEC exists which has
> AER capability.  There's an "rcec" pointer in struct pci_dev which
> allows discovering the RCEC responsible for an RCiEP.  But the pointer
> is only set when portdrv binds to the RCEC (pcie_link_rcec()).
> That's much later than when the RCiEP and its capabilities are enumerated.
> 
> When enumerating an RCiEP, we'd need to walk the entire set of PCI devices,
> check if it's an RCEC, check if it's responsible for this RCiEP and assign
> the rcec pointer.  We could try to avoid that by running pcie_link_rcec()
> already on enumeration of the RCEC (and not on probing of portdrv),
> but the RCEC may be enumerated after the RCiEP.  User space could also
> force an unset rcec pointer by issuing remove/rescan of the RCiEP.
> 
> Also, right now when firmware does keep System Error Enable bits in the
> Root Control register set, there's a window between endpoints being
> enumerated (which enables sending of ERR_* messages) and Root Ports
> being bound to portdrv (which clears System Error Enable bits).
> 

Agreed, the RCiEP case makes this hard, and the window already exists.

Could you add a sentence to the commit message noting that reporting
is now also enabled on AER-incapable devices below AER-incapable Root
Ports?  That way, if someone bisects a new System Error to this
commit, the reason is obvious.


> Any errors that occur during that window will cause a System Error
> right now.
> 
>> Or alternatively, clear the Root Control System Error
>> enable bits on AER-incapable Root Ports?
> 
> I'm worried that users may deliberately enable System Error bits in
> BIOS on such systems precisely because there's no other way to catch
> them.
> 

Fair point, let's leave them alone.


> Thanks for the thoughtful review, much appreciated!
> 
> Lukas

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


      reply	other threads:[~2026-10-01 17:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27 18:02 [PATCH 0/7] Error reporting for AER-incapable devices Lukas Wunner
2026-09-27 18:02 ` [PATCH 1/7] PCI/DPC: Avoid access to non-existent AER capability Lukas Wunner
2026-09-27 18:27   ` sashiko-bot
2026-09-29 18:49   ` Kuppuswamy Sathyanarayanan
2026-09-27 18:02 ` [PATCH 2/7] PCI/DPC: Reinstate support for AER-incapable ports Lukas Wunner
2026-09-27 18:26   ` sashiko-bot
2026-09-29 19:04   ` Kuppuswamy Sathyanarayanan
2026-09-27 18:02 ` [PATCH 3/7] PCI/ERR: Avoid stale error status bits on recovery failure Lukas Wunner
2026-09-27 18:31   ` sashiko-bot
2026-09-27 18:57     ` Lukas Wunner
2026-09-29 19:20   ` Kuppuswamy Sathyanarayanan
2026-09-27 18:02 ` [PATCH 4/7] PCI/AER: Drop AER native check from handles_cxl_errors() Lukas Wunner
2026-09-27 18:26   ` sashiko-bot
2026-09-28 20:58   ` Bowman, Terry
2026-09-29 19:24   ` Kuppuswamy Sathyanarayanan
2026-09-27 18:02 ` [PATCH 5/7] PCI/AER: Move AER capability check out of pcie_aer_is_native() Lukas Wunner
2026-09-27 18:30   ` sashiko-bot
2026-09-29 19:47   ` Kuppuswamy Sathyanarayanan
2026-09-27 18:02 ` [PATCH 6/7] PCI/AER: Renumber severity constants Lukas Wunner
2026-09-27 18:29   ` sashiko-bot
2026-09-27 19:23     ` Lukas Wunner
2026-09-29 19:55   ` Kuppuswamy Sathyanarayanan
2026-09-27 18:02 ` [PATCH 7/7] PCI/AER: Enable baseline capability error reporting Lukas Wunner
2026-09-27 18:33   ` sashiko-bot
2026-09-29 21:01   ` Kuppuswamy Sathyanarayanan
2026-09-30  7:08     ` Lukas Wunner
2026-10-01 17:44       ` Kuppuswamy Sathyanarayanan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=faf9a756-2682-49f7-a6a1-2a46515f773d@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=aravind.iddamsetty@intel.com \
    --cc=helgaas@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lukas@wunner.de \
    --cc=mahesh@linux.ibm.com \
    --cc=mattc@purestorage.com \
    --cc=oohall@gmail.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=srinivasa.adatrao@intel.com \
    --cc=terry.bowman@amd.com \
    --cc=yurypm@arista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox