From: sashiko-bot@kernel.org
To: "Lukas Wunner" <lukas@wunner.de>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 3/7] PCI/ERR: Avoid stale error status bits on recovery failure
Date: Sun, 27 Sep 2026 18:31:22 +0000 [thread overview]
Message-ID: <20260927183122.8B3F91F000FF@smtp.kernel.org> (raw)
In-Reply-To: <c7048e7dafe470f1f85709169c31b5aafe7ad59f.1790531238.git.lukas@wunner.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] pci: stale fatal AER status bits left uncleared on recovery failure path
--
commit f65c6a5d555f5001060d8335ce4ca73c0130b547
Author: Yury Murashka <yurypm@arista.com>
PCI/ERR: Avoid stale error status bits on recovery failure
This commit clears error status bits on recovery failure to prevent the
AER driver from falsely identifying unaffected devices as the source of
new errors. It does this by calling pcie_clear_device_status() and
pci_aer_clear_nonfatal_status() on the failure path in pcie_do_recovery().
Link: https://lore.kernel.org/r/CAPzpGcRCTCZtaX1EVaJNZ103THZKsoszZduY7=gwfYdcrMo-SQ@mail.gmail.com/
> diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
> --- a/drivers/pci/pcie/err.c
> +++ b/drivers/pci/pcie/err.c
> @@ -284,6 +284,11 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
> return status;
>
> failed:
> + if (host->native_aer || pcie_ports_native) {
> + pcie_clear_device_status(dev);
> + pci_aer_clear_nonfatal_status(dev);
[Severity: Medium]
When pcie_do_recovery() is invoked for a fatal error (pci_channel_io_frozen)
and recovery fails, will this leave the fatal error bits uncleared?
Looking at pci_aer_clear_nonfatal_status() in drivers/pci/pcie/aer.c, it
explicitly masks out fatal errors before writing back to the status register:
pci_read_config_dword(dev, aer + PCI_ERR_UNCOR_STATUS, &status);
pci_read_config_dword(dev, aer + PCI_ERR_UNCOR_SEVER, &sev);
status &= ~sev;
if (status)
pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_STATUS, status);
If a fatal error occurred, the severity bit is 1, so the status bit is never
cleared. Could this leave stale fatal error bits that cause subsequent
is_error_source() checks to falsely identify this device?
Should this failure path use pci_aer_clear_status() or explicitly clear all
uncorrectable errors instead?
> + }
> +
> pci_walk_bridge(bridge, pci_pm_runtime_put, NULL);
>
> pci_walk_bridge(bridge, report_perm_failure_detected, NULL);
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1790531238.git.lukas@wunner.de?part=3
next prev parent reply other threads:[~2026-09-27 18:31 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 [this message]
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
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=20260927183122.8B3F91F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=sashiko-reviews@lists.linux.dev \
/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