From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>,
Bjorn Helgaas <helgaas@kernel.org>,
Raag Jadav <raag.jadav@intel.com>,
linux-pci@vger.kernel.org
Cc: Sourabh Jain <sourabhjain@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>,
Maciej Grochowski <Maciej.Grochowski@sony.com>,
Yazen Ghannam <yazen.ghannam@amd.com>,
Darshit Shah <darnshah@amazon.de>,
Jason Perlow <jperlow@gmail.com>,
Riana Tauro <riana.tauro@intel.com>,
Yury Murashka <yurypm@arista.com>,
Matthew W Carlis <mattc@purestorage.com>
Subject: Re: [PATCH v2 4/7] PCI/ERR: Avoid stale error status bits on recovery failure
Date: Wed, 18 Nov 2026 08:05:35 -0800 [thread overview]
Message-ID: <5eb12731-208b-4be0-84d7-9131810b7842@linux.intel.com> (raw)
In-Reply-To: <2d0191cb7b92da82302f9d37b859e28ee6c9c85e.1794997749.git.lukas@wunner.de>
On 11/18/26 02:40, Lukas Wunner wrote:
> From: Yury Murashka <yurypm@arista.com>
>
> pcie_do_recovery() only clears the error status bits of an error-reporting
> device if recovery succeeds, but not if it fails. (E.g. because reset
> failed, drivers are missing pci_error_handlers or those handlers failed.)
>
> One undesirable consequence is that the AER driver may subsequently
> identify a wrong device when searching for error-reporting devices in
> is_error_source(), due to stale bits on an unaffected device.
>
> Avoid by clearing error status bits on recovery failure.
>
> If recovery succeeds, Fatal Errors are generally cleared by a call to
> pci_restore_state() from drivers' ->slot_reset() callbacks. If recovery
> fails, those callbacks may not have been invoked or they may not be
> implemented. Hence clear Fatal Errors as well on recovery failure.
>
> Link: https://lore.kernel.org/r/CAPzpGcRCTCZtaX1EVaJNZ103THZKsoszZduY7=gwfYdcrMo-SQ@mail.gmail.com/
> Signed-off-by: Yury Murashka <yurypm@arista.com>
> [lukas: drop cmdline param, rewrite commit msg, clear fatal errors]
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> ---
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Changes v1 -> v2:
> * Clear Fatal Errors as well on recovery failure (Sathya, sashiko).
>
> drivers/pci/pcie/err.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
> index 24a8a8263c2e..a450146fb285 100644
> --- a/drivers/pci/pcie/err.c
> +++ b/drivers/pci/pcie/err.c
> @@ -289,6 +289,13 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
> return status;
>
> failed:
> + if (host->native_aer) {
> + pcie_capability_write_word(dev, PCI_EXP_DEVSTA,
> + PCI_EXP_DEVSTA_UNC_MASK);
> + pci_aer_clear_nonfatal_status(dev);
> + pci_aer_clear_fatal_status(dev);
> + }
> +
> pci_walk_bridge(bridge, pci_pm_runtime_put, NULL);
>
> pci_walk_bridge(bridge, report_perm_failure_detected, NULL);
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
next prev parent reply other threads:[~2026-11-18 16:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
2026-11-18 10:40 ` [PATCH v2 1/7] PCI/DPC: Avoid access to non-existent AER capability Lukas Wunner
2026-11-18 11:04 ` sashiko-bot
2026-11-18 16:00 ` Kuppuswamy Sathyanarayanan
2026-11-18 10:40 ` [PATCH v2 2/7] PCI/DPC: Reinstate support for AER-incapable ports Lukas Wunner
2026-11-18 11:03 ` sashiko-bot
2026-11-18 10:40 ` [PATCH v2 3/7] PCI/ERR: Clear error status bits more selectively Lukas Wunner
2026-11-18 11:09 ` sashiko-bot
2026-11-18 16:04 ` Kuppuswamy Sathyanarayanan
2026-11-18 10:40 ` [PATCH v2 4/7] PCI/ERR: Avoid stale error status bits on recovery failure Lukas Wunner
2026-11-18 11:18 ` sashiko-bot
2026-11-18 16:05 ` Kuppuswamy Sathyanarayanan [this message]
2026-11-18 10:40 ` [PATCH v2 5/7] PCI/AER: Drop AER native check from handles_cxl_errors() Lukas Wunner
2026-11-18 11:02 ` sashiko-bot
2026-11-18 10:40 ` [PATCH v2 6/7] PCI/AER: Move AER capability check out of pcie_aer_is_native() Lukas Wunner
2026-11-18 11:13 ` sashiko-bot
2026-11-18 10:40 ` [PATCH v2 7/7] PCI/AER: Enable baseline capability error reporting Lukas Wunner
2026-11-18 11:19 ` sashiko-bot
2026-11-18 22:17 ` Lukas Wunner
2026-11-19 1:03 ` [PATCH v2 0/7] Error reporting for AER-incapable devices Jason Perlow
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=5eb12731-208b-4be0-84d7-9131810b7842@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=Maciej.Grochowski@sony.com \
--cc=aravind.iddamsetty@intel.com \
--cc=darnshah@amazon.de \
--cc=helgaas@kernel.org \
--cc=jperlow@gmail.com \
--cc=kbusch@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lukas@wunner.de \
--cc=mattc@purestorage.com \
--cc=oohall@gmail.com \
--cc=raag.jadav@intel.com \
--cc=riana.tauro@intel.com \
--cc=sourabhjain@linux.ibm.com \
--cc=srinivasa.adatrao@intel.com \
--cc=terry.bowman@amd.com \
--cc=yazen.ghannam@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