From: sashiko-bot@kernel.org
To: "Manivannan Sadhasivam" <manivannan.sadhasivam@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v9 3/5] PCI: host-common: Add link down handling for Root Ports
Date: Wed, 29 Jul 2026 05:07:05 +0000 [thread overview]
Message-ID: <20260729050706.0C5E31F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260729-pci-port-reset-v9-3-53570b92064d@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Silent device state corruption on link recovery when AER is disabled.
--
--- Patch [3]: [PATCH v9 3/5] PCI: host-common: Add link down handling for Root Ports ---
commit f0b63bf7d7d526d3c654256d686360e1e2906b25
Author: Manivannan Sadhasivam <mani@kernel.org>
PCI: host-common: Add link down handling for Root Ports
This commit introduces a new API pci_host_handle_link_down() to recover PCI
links that go down. It uses pcie_do_recovery() for AER-enabled kernels to
handle fatal errors and coordinate downstream driver recovery. For kernels
without AER, it falls back to resetting the root port directly.
> diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c
> index 2ce6f4b661334..363d3f970b10c 100644
> --- a/drivers/pci/controller/pci-host-common.c
> +++ b/drivers/pci/controller/pci-host-common.c
[ ... ]
> +static void pci_host_recover_root_port(struct pci_dev *port)
> +{
> +#if IS_ENABLED(CONFIG_PCIEAER)
> + pcie_do_recovery(port, pci_channel_io_frozen, pci_host_reset_root_port);
> +#else
> + pci_host_reset_root_port(port);
[Severity: High]
Without AER enabled, this falls back to calling pci_host_reset_root_port(),
which resets the downstream bus using pci_bus_error_reset().
Because pci_bus_error_reset() utilizes PCI_RESET_NO_RESTORE, does this wipe
the configuration space (BARs, MSI, Memory/Bus Master Enable) of all
downstream devices?
Since pcie_do_recovery() is bypassed in this branch, downstream drivers are
never notified via slot_reset callbacks to restore their configuration state.
Could those drivers remain active and continue attempting MMIO accesses to
unmapped or disabled memory regions, leading to Master Aborts, timeouts,
or kernel crashes?
> +#endif
> +}
> +
> +void pci_host_handle_link_down(struct pci_dev *port)
> +{
> + pci_info(port, "Recovering Root Port due to Link Down\n");
> + pci_host_recover_root_port(port);
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260729-pci-port-reset-v9-0-53570b92064d@oss.qualcomm.com?part=3
next prev parent reply other threads:[~2026-07-29 5:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 4:52 [PATCH v9 0/5] PCI: Add support for resetting the Root Ports in a platform specific way Manivannan Sadhasivam via B4 Relay
2026-07-29 4:52 ` [PATCH v9 1/5] PCI: dwc: ep: Clear MSI iATU mapping in dw_pcie_ep_cleanup() Manivannan Sadhasivam via B4 Relay
2026-07-29 5:15 ` sashiko-bot
2026-07-29 4:52 ` [PATCH v9 2/5] PCI/ERR: Add support for resetting the Root Ports in a platform specific way Manivannan Sadhasivam via B4 Relay
2026-07-29 5:07 ` sashiko-bot
2026-07-29 4:52 ` [PATCH v9 3/5] PCI: host-common: Add link down handling for Root Ports Manivannan Sadhasivam via B4 Relay
2026-07-29 5:07 ` sashiko-bot [this message]
2026-07-29 4:52 ` [PATCH v9 4/5] PCI: qcom: Add support for resetting the Root Port due to link down event Manivannan Sadhasivam via B4 Relay
2026-07-29 5:20 ` sashiko-bot
2026-07-29 4:52 ` [PATCH v9 5/5] misc: pci_endpoint_test: Add AER error handlers Manivannan Sadhasivam via B4 Relay
2026-07-29 5:07 ` sashiko-bot
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=20260729050706.0C5E31F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--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