linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Manivannan Sadhasivam <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>,
	"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>,
	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 4/5] PCI: host-common: Add link down handling for host bridges
Date: Mon, 2 Jun 2025 16:13:44 -0500	[thread overview]
Message-ID: <20250602211344.GA444082@bhelgaas> (raw)
In-Reply-To: <bixtbu7hzs5rwrgj22ff53souxvpd7vqysktpcnxvd66jrsizf@pelid4rjhips>

On Fri, May 30, 2025 at 09:39:28PM +0530, Manivannan Sadhasivam wrote:
> On Fri, May 30, 2025 at 06:34:04AM -0500, Bjorn Helgaas wrote:
> > On Fri, May 30, 2025 at 09:16:59AM +0530, Manivannan Sadhasivam wrote:
> > > On Wed, May 28, 2025 at 05:35:00PM -0500, Bjorn Helgaas wrote:
> > > > On Thu, May 08, 2025 at 12:40:33PM +0530, Manivannan Sadhasivam wrote:
> > > > > The PCI link, when down, needs to be recovered to bring it back. But that
> > > > > cannot be done in a generic way as link recovery procedure is specific to
> > > > > host bridges. So add a new API pci_host_handle_link_down() that could be
> > > > > called by the host bridge drivers when the link goes down.
> > > > > 
> > > > > The API will iterate through all the slots and calls the pcie_do_recovery()
> > > > > function with 'pci_channel_io_frozen' as the state. This will result in the
> > > > > execution of the AER Fatal error handling code. Since the link down
> > > > > recovery is pretty much the same as AER Fatal error handling,
> > > > > pcie_do_recovery() helper is reused here. First the AER error_detected
> > > > > callback will be triggered for the bridge and the downstream devices. Then,
> > > > > pci_host_reset_slot() will be called for the slot, which will reset the
> > > > > slot using 'reset_slot' callback to recover the link. Once that's done,
> > > > > resume message will be broadcasted to the bridge and the downstream devices
> > > > > indicating successful link recovery.
> > > > 
> > > > Link down is an event for a single Root Port.  Why would we iterate
> > > > through all the Root Ports if the link went down for one of them?
> > > 
> > > Because on the reference platform (Qcom), link down notification is
> > > not per-port, but per controller. So that's why we are iterating
> > > through all ports.  The callback is supposed to identify the ports
> > > that triggered the link down event and recover them.
> > 
> > Maybe I'm missing something.  Which callback identifies the port(s)
> > that triggered the link down event?
> 
> I was referring to the host_bridge::reset_root_port() callback that resets the
> root ports.
> 
> >  I see that
> > pci_host_handle_link_down() is called by
> > rockchip_pcie_rc_sys_irq_thread() and qcom_pcie_global_irq_thread(),
> > but I don't see the logic that identifies a particular Root Port.
> > 
> > Per-controller notification of per-port events is a controller
> > deficiency, not something inherent to PCIe.  I don't think we should
> > build common infrastructure that resets all the Root Ports just
> > because one of them had an issue.
> 
> Hmm, fair enough.
> 
> > I think pci_host_handle_link_down() should take a Root Port, not a
> > host bridge, and the controller driver should figure out which port
> > needs to be recovered, or the controller driver can have its own loop
> > to recover all of them if it can't figure out which one needs it.
> 
> This should also work. Feel free to drop the relevant commits for
> v6.16, I can resubmit them (including dw-rockchip after -rc1).

OK, I kept "PCI: host-common: Make the driver as a common library for
host controller drivers" (renamed to "PCI: host-common: Convert to
library for host controller drivers") on pci/controller/dw-rockchip
for v6.16 and deferred the rest until later.


  reply	other threads:[~2025-06-02 21:13 UTC|newest]

Thread overview: 28+ 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-08  7:18   ` Lukas Wunner
2025-05-09  2:59   ` Wilfred Mallawa
2025-05-14  6:33   ` Krishna Chaitanya Chundru
2025-05-14 16:42   ` Sathyanarayanan Kuppuswamy
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 [this message]
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=20250602211344.GA444082@bhelgaas \
    --to=helgaas@kernel.org \
    --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).