linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@linux.intel.com>
To: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"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>,
	"Zhou Wang" <wangzhou1@hisilicon.com>,
	"Will Deacon" <will@kernel.org>,
	"Robert Richter" <rric@kernel.org>,
	"Alyssa Rosenzweig" <alyssa@rosenzweig.io>,
	"Marc Zyngier" <maz@kernel.org>,
	"Conor Dooley" <conor.dooley@microchip.com>,
	"Daire McNamara" <daire.mcnamara@microchip.com>
Cc: dingwei@marvell.com, cassel@kernel.org,
	Lukas Wunner <lukas@wunner.de>,
	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,
	linux-arm-kernel@lists.infradead.org,
	linux-riscv@lists.infradead.org
Subject: Re: [PATCH v4 2/5] PCI/ERR: Add support for resetting the slots in a platform specific way
Date: Wed, 14 May 2025 09:42:16 -0700	[thread overview]
Message-ID: <abe64cda-729e-44e2-bc1e-d43d3566980e@linux.intel.com> (raw)
In-Reply-To: <20250508-pcie-reset-slot-v4-2-7050093e2b50@linaro.org>


On 5/8/25 12:10 AM, Manivannan Sadhasivam wrote:
> Some host bridge devices require resetting the slots in a platform specific
> way to recover them from error conditions such as Fatal AER errors, Link
> Down etc... So introduce pci_host_bridge::reset_slot callback and call it
> from pcibios_reset_secondary_bus() if available.
>
> 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.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---

Looks good to me.

Reviewed-by: Kuppuswamy Sathyanarayanan 
<sathyanarayanan.kuppuswamy@linux.intel.com>

>   drivers/pci/pci.c      | 12 ++++++++++++
>   drivers/pci/pcie/err.c |  5 -----
>   include/linux/pci.h    |  1 +
>   3 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 4d7c9f64ea24ec754a135a2585c99489cfa641a9..13709bb898a967968540826a2b7ee8ade6b7e082 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -4982,7 +4982,19 @@ void pci_reset_secondary_bus(struct pci_dev *dev)
>   
>   void __weak pcibios_reset_secondary_bus(struct pci_dev *dev)
>   {
> +	struct pci_host_bridge *host = pci_find_host_bridge(dev->bus);
> +	int ret;
> +
> +	if (host->reset_slot) {
> +		ret = host->reset_slot(host, dev);
> +		if (ret)
> +			pci_err(dev, "failed to reset slot: %d\n", ret);
> +
> +		return;
> +	}
> +
>   	pci_reset_secondary_bus(dev);
> +
>   }
>   
>   /**
> diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
> index de6381c690f5c21f00021cdc7bde8d93a5c7db52..b834fc0d705938540d3d7d3d8739770c09fe7cf1 100644
> --- a/drivers/pci/pcie/err.c
> +++ b/drivers/pci/pcie/err.c
> @@ -234,11 +234,6 @@ 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?
> -		 */
>   		status = PCI_ERS_RESULT_RECOVERED;
>   		pci_dbg(bridge, "broadcast slot_reset message\n");
>   		pci_walk_bridge(bridge, report_slot_reset, &status);
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 0e8e3fd77e96713054388bdc82f439e51023c1bf..8d7d2a49b76cf64b4218b179cec495e0d69ddf6f 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -599,6 +599,7 @@ struct pci_host_bridge {
>   	void (*release_fn)(struct pci_host_bridge *);
>   	int (*enable_device)(struct pci_host_bridge *bridge, struct pci_dev *dev);
>   	void (*disable_device)(struct pci_host_bridge *bridge, struct pci_dev *dev);
> +	int (*reset_slot)(struct pci_host_bridge *bridge, struct pci_dev *dev);
>   	void		*release_data;
>   	unsigned int	ignore_reset_delay:1;	/* For entire hierarchy */
>   	unsigned int	no_ext_tags:1;		/* No Extended Tags */
>
-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer



  parent reply	other threads:[~2025-05-14 18:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08  7:10 [PATCH v4 0/5] PCI: Add support for resetting the slots in a platform specific way Manivannan Sadhasivam
2025-05-08  7:10 ` [PATCH v4 1/5] PCI/ERR: Remove misleading TODO regarding kernel panic Manivannan Sadhasivam
2025-05-09  3:04   ` Wilfred Mallawa
2025-05-09  6:11   ` Ethan Zhao
2025-05-09  6:51     ` Manivannan Sadhasivam
2025-05-14 16:39   ` Sathyanarayanan Kuppuswamy
2025-05-08  7:10 ` [PATCH v4 2/5] PCI/ERR: Add support for resetting the slots in a platform specific way Manivannan Sadhasivam
2025-05-09  2:59   ` Wilfred Mallawa
2025-05-14  6:33   ` Krishna Chaitanya Chundru
2025-05-14 16:42   ` Sathyanarayanan Kuppuswamy [this message]
2025-05-08  7:10 ` [PATCH v4 3/5] PCI: host-common: Make the driver as a common library for host controller drivers Manivannan Sadhasivam
2025-05-08  7:10 ` [PATCH v4 4/5] PCI: host-common: Add link down handling for host bridges Manivannan Sadhasivam
2025-05-14  6:30   ` Krishna Chaitanya Chundru
2025-05-14 16:33     ` Manivannan Sadhasivam
2025-05-28 22:35   ` Bjorn Helgaas
2025-05-30  3:46     ` Manivannan Sadhasivam
2025-05-30 11:34       ` Bjorn Helgaas
2025-05-30 16:09         ` Manivannan Sadhasivam
2025-06-02 21:13           ` Bjorn Helgaas
2025-07-07 11:05           ` Niklas Cassel
2025-07-07 11:29             ` Niklas Cassel
2025-07-09 12:32               ` Manivannan Sadhasivam
2025-06-02 21:19   ` Bjorn Helgaas
2025-05-08  7:10 ` [PATCH v4 5/5] PCI: qcom: Add support for resetting the slot due to link down event Manivannan Sadhasivam
2025-05-14  6:22   ` Krishna Chaitanya Chundru
2025-05-14 16:35     ` Manivannan Sadhasivam
2025-05-14 16:32 ` [PATCH v4 0/5] PCI: Add support for resetting the slots in a platform specific way Manivannan Sadhasivam

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=abe64cda-729e-44e2-bc1e-d43d3566980e@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=alyssa@rosenzweig.io \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=daire.mcnamara@microchip.com \
    --cc=dingwei@marvell.com \
    --cc=krishna.chundru@oss.qualcomm.com \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lpieralisi@kernel.org \
    --cc=lukas@wunner.de \
    --cc=mahesh@linux.ibm.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=maz@kernel.org \
    --cc=oohall@gmail.com \
    --cc=robh@kernel.org \
    --cc=rric@kernel.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=will@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).