From: Bjorn Helgaas <helgaas@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: linux-pci@vger.kernel.org,
Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Oliver OHalloran <oohall@gmail.com>,
linuxppc-dev@lists.ozlabs.org, Stefan Roese <sr@denx.de>
Subject: Re: [PATCH] PCI/AER: Stop ruling out unbound devices as error source
Date: Mon, 30 Mar 2026 14:19:49 -0500 [thread overview]
Message-ID: <20260330191949.GA90884@bhelgaas> (raw)
In-Reply-To: <734338c2e8b669db5a5a3b45d34131b55ffebfca.1774605029.git.lukas@wunner.de>
On Fri, Mar 27, 2026 at 10:56:43AM +0100, Lukas Wunner wrote:
> When searching for the error source, the AER driver rules out devices
> whose enable_cnt is zero. This was introduced in 2009 by commit
> 28eb27cf0839 ("PCI AER: support invalid error source IDs") without
> providing a rationale.
>
> Drivers typically call pci_enable_device() on probe, hence the enable_cnt
> check essentially filters out unbound devices. At the time of the commit,
> drivers had to opt in to AER by calling pci_enable_pcie_error_reporting()
> and so any AER-enabled device could be assumed to be bound to a driver.
> The check thus made sense because it allowed skipping config space
> accesses to devices which were known not to be the error source.
>
> But since 2022, AER is universally enabled on all devices when they are
> enumerated, cf. commit f26e58bf6f54 ("PCI/AER: Enable error reporting when
> AER is native").
>
> Errors may very well be reported by unbound devices, e.g. due to link
> instability. By ruling them out as error source, errors reported by them
> are neither logged nor cleared. When they do get bound and another error
> occurs, the earlier error is reported together with the new error, which
> may confuse users. Stop doing so.
>
> Fixes: f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native")
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: stable@vger.kernel.org # v6.0+
Applied to pci/aer for v7.1, thanks!
> ---
> drivers/pci/pcie/aer.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 4299c55..384d026 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -1039,8 +1039,6 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
> * 3) There are multiple errors and prior ID comparing fails;
> * We check AER status registers to find possible reporter.
> */
> - if (atomic_read(&dev->enable_cnt) == 0)
> - return false;
>
> /* Check if AER is enabled */
> pcie_capability_read_word(dev, PCI_EXP_DEVCTL, ®16);
> --
> 2.51.0
>
prev parent reply other threads:[~2026-03-30 19:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 9:56 [PATCH] PCI/AER: Stop ruling out unbound devices as error source Lukas Wunner
2026-03-30 6:32 ` Stefan Roese
2026-03-30 19:19 ` Bjorn Helgaas [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=20260330191949.GA90884@bhelgaas \
--to=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lukas@wunner.de \
--cc=mahesh@linux.ibm.com \
--cc=oohall@gmail.com \
--cc=sr@denx.de \
/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