All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>,
	Bjorn Helgaas <helgaas@kernel.org>,
	linux-pci@vger.kernel.org
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>,
	Oliver OHalloran <oohall@gmail.com>,
	linuxppc-dev@lists.ozlabs.org, Keith Busch <kbusch@kernel.org>,
	Maciej Grochowski <Maciej.Grochowski@sony.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>
Subject: Re: [PATCH] PCI/AER: Check error status registers if Error Source ID is zero
Date: Mon, 30 Nov 2026 07:04:57 -0800	[thread overview]
Message-ID: <fa68dad4-3b03-4601-b410-00e1f1e8eab7@linux.intel.com> (raw)
In-Reply-To: <1ddc35c51b5317988bbf235c467a9534218c6ea4.1795717157.git.lukas@wunner.de>

Hi,

On 11/26/26 10:35, Lukas Wunner wrote:
> Since commit 6d69eeae8966 ("PCI/AER: Check validity of Error Source ID
> register"), the AER driver checks whether the Error Source ID register
> contains either the ID of the Root Port (or RCEC) itself, or of a device
> subordinate to the Root Port (or associated with the RCEC).
> 
> If this check succeeds, the Error Source ID register is assumed to contain
> a valid value and is not double-checked by reading error status registers.
> 
> However per PCIe r7.1 sec 2.2.9.1, devices may send Completions with a
> zero Completer ID "prior to the initial device Configuration Write
> Request".  Similarly, CXL r4.0 sec 8.1.5.1 states that a Component may
> generate a CREDIT_RTN IP2PM message with a zero bus number after reset,
> which can fail ACS Source Validation and trigger an ACS Violation Error.
> 
> On ARM platforms, there is often a Root Port at address 0000:00:00.0,
> which makes it impossible to discern whether a zero Error Source ID refers
> to the Root Port or to an uninitialized device downstream.
> 
> For this reason, always double-check error status registers if the Error
> Source ID is zero.
> 
> Fixes: 6d69eeae8966 ("PCI/AER: Check validity of Error Source ID register")
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> ---

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

> base-commit: 6d69eeae8966bc3bea0facbd550f45ef9de41cc4
>  
> This fixes a commit queued on pci/aer.  It can either be folded into
> that commit or applied on top of pci/aer, whichever is preferred.
>  
>  drivers/pci/pcie/aer.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 1973b6e..24b014b 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -1158,6 +1158,10 @@ static int add_error_device(struct aer_err_info *e_info, struct pci_dev *dev)
>  
>  static bool source_id_valid(struct pci_dev *root, u16 id)
>  {
> +	/* ID is zero prior to initial device config (PCIe r7.1 sec 2.2.9.1) */
> +	if (id == 0)
> +		return true;
> +
>  	/* The Root Port or RCEC can itself be a valid Error Source */
>  	if (pci_dev_id(root) == id)
>  		return true;
> @@ -1186,7 +1190,7 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
>  	u16 reg16;
>  
>  	/* Some Root Ports report an invalid Error Source ID */
> -	if (e_info->id_valid &&
> +	if (e_info->id && e_info->id_valid &&
>  	    !(dev->bus->bus_flags & PCI_BUS_FLAGS_NO_AERSID)) {
>  		/* Device ID match? */
>  		if (e_info->id == pci_dev_id(dev))

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


  parent reply	other threads:[~2026-11-30 15:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 18:35 [PATCH] PCI/AER: Check error status registers if Error Source ID is zero Lukas Wunner
2026-11-26 18:42 ` sashiko-bot
2026-11-30 15:04 ` Kuppuswamy Sathyanarayanan [this message]
2026-11-30 16:18 ` Yazen Ghannam
2026-11-30 17:09   ` Lukas Wunner
2026-11-30 18:02     ` Yazen Ghannam
2026-11-30 18:10       ` Lukas Wunner

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=fa68dad4-3b03-4601-b410-00e1f1e8eab7@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=Maciej.Grochowski@sony.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=oohall@gmail.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=yazen.ghannam@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.