From: Lukas Wunner <lukas@wunner.de>
To: manivannan.sadhasivam@linaro.org
Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Oliver O'Halloran <oohall@gmail.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Krzysztof Wilczy??ski <kw@linux.com>,
Rob Herring <robh@kernel.org>,
dingwei@marvell.com, cassel@kernel.org,
Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>,
linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 2/4] PCI/ERR: Add support for resetting the slot in a platforms specific way
Date: Fri, 4 Apr 2025 10:46:27 +0200 [thread overview]
Message-ID: <Z--cY5Uf6JyTYL9y@wunner.de> (raw)
In-Reply-To: <20250404-pcie-reset-slot-v1-2-98952918bf90@linaro.org>
On Fri, Apr 04, 2025 at 01:52:22PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> When the PCI error handling requires resetting the slot, reset it using the
> host bridge specific 'reset_slot' callback if available before calling the
> 'slot_reset' callback of the PCI drivers.
>
> The 'reset_slot' callback is responsible for resetting the given slot
> referenced by the 'pci_dev' pointer in a platform specific way and bring it
> back to the working state if possible. If any error occurs during the slot
> reset operation, relevant errno should be returned.
[...]
> --- a/drivers/pci/pcie/err.c
> +++ b/drivers/pci/pcie/err.c
> @@ -234,11 +234,16 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
> }
>
> if (status == PCI_ERS_RESULT_NEED_RESET) {
> - /*
> - * TODO: Should call platform-specific
> - * functions to reset slot before calling
> - * drivers' slot_reset callbacks?
> - */
> + if (host->reset_slot) {
> + ret = host->reset_slot(host, bridge);
> + if (ret) {
> + pci_err(bridge, "failed to reset slot: %d\n",
> + ret);
> + status = PCI_ERS_RESULT_DISCONNECT;
> + goto failed;
> + }
> + }
> +
This feels like something that should be plumbed into
pcibios_reset_secondary_bus(), rather than pcie_do_recovery().
Note that in the DPC case, pcie_do_recovery() doesn't issue a reset
itself. The reset has already happened, it was automatically done
by the hardware and all the kernel needs to do is bring up the link
again. Do you really need any special handling for that in the
host controller driver?
Only in the AER case do you want to issue a reset on the secondary bus
and if there's any platform-specific support needed for that, it needs
to go into pcibios_reset_secondary_bus().
Thanks,
Lukas
next prev parent reply other threads:[~2025-04-04 8:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 8:22 [PATCH 0/4] PCI: Add support for resetting the slots in a platform specific way Manivannan Sadhasivam via B4 Relay
2025-04-04 8:22 ` [PATCH 1/4] PCI/ERR: Remove misleading TODO regarding kernel panic Manivannan Sadhasivam via B4 Relay
2025-04-04 8:22 ` [PATCH 2/4] PCI/ERR: Add support for resetting the slot in a platforms specific way Manivannan Sadhasivam via B4 Relay
2025-04-04 8:46 ` Lukas Wunner [this message]
2025-04-15 13:33 ` Manivannan Sadhasivam
2025-04-16 14:38 ` Lukas Wunner
2025-04-16 15:04 ` Manivannan Sadhasivam
2025-04-17 0:23 ` Lukas Wunner
2025-04-17 5:39 ` Manivannan Sadhasivam
2025-04-17 11:42 ` Lukas Wunner
2025-04-04 8:22 ` [PATCH 3/4] PCI: Add link down handling for host bridges Manivannan Sadhasivam via B4 Relay
2025-04-04 8:22 ` [PATCH 4/4] PCI: qcom: Add support for resetting the slot due to link down event Manivannan Sadhasivam via B4 Relay
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=Z--cY5Uf6JyTYL9y@wunner.de \
--to=lukas@wunner.de \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=dingwei@marvell.com \
--cc=krishna.chundru@oss.qualcomm.com \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lpieralisi@kernel.org \
--cc=mahesh@linux.ibm.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=oohall@gmail.com \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).