linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
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>,
	"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, "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, wilfred.mallawa@wdc.com
Subject: Re: [PATCH v3 5/5] PCI: qcom: Add support for resetting the slot due to link down event
Date: Mon, 5 May 2025 17:05:10 +0200	[thread overview]
Message-ID: <aBjTpglI5_P2Q3Aa@ryzen> (raw)
In-Reply-To: <20250417-pcie-reset-slot-v3-5-59a10811c962@linaro.org>

Hello Mani,

On Thu, Apr 17, 2025 at 10:46:31PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> @@ -1571,6 +1652,9 @@ static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
>  		pci_unlock_rescan_remove();
>  
>  		qcom_pcie_icc_opp_update(pcie);
> +	} else if (FIELD_GET(PARF_INT_ALL_LINK_DOWN, status)) {
> +		dev_dbg(dev, "Received Link down event\n");
> +		pci_host_handle_link_down(pp->bridge);
>  	} else {
>  		dev_WARN_ONCE(dev, 1, "Received unknown event. INT_STATUS: 0x%08x\n",
>  			      status);

From debugging an unrelated problem, I noticed that dw-rockchip can
sometimes have both "link up" bit and "hot reset or link down" bit set
at the same time, when reading the status register.

Perhaps the link went down very quickly and then was established again
by the time the threaded IRQ handler gets to run.

Your code seems to do an if + else if.

Without knowing how the events work for your platforms, I would guess
that it should also be possible to have multiple events set.


In you code, if both LINK UP and hot reset/link down are set,
I would assume that you driver will not do the right thing.

Perhaps you want to swap the order? So that link down is handled first,
and then link up is handled. (If you convert to "if + if "instead of
"if + else if" that is.)


Kind regards,
Niklas


  parent reply	other threads:[~2025-05-05 15:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17 17:16 [PATCH v3 0/5] PCI: Add support for resetting the slots in a platform specific way Manivannan Sadhasivam via B4 Relay
2025-04-17 17:16 ` [PATCH v3 1/5] PCI/ERR: Remove misleading TODO regarding kernel panic Manivannan Sadhasivam via B4 Relay
2025-04-17 17:16 ` [PATCH v3 2/5] PCI/ERR: Add support for resetting the slots in a platform specific way Manivannan Sadhasivam via B4 Relay
2025-04-17 17:16 ` [PATCH v3 3/5] PCI: host-common: Make the driver as a common library for host controller drivers Manivannan Sadhasivam via B4 Relay
2025-04-17 17:16 ` [PATCH v3 4/5] PCI: host-common: Add link down handling for host bridges Manivannan Sadhasivam via B4 Relay
2025-04-17 17:16 ` [PATCH v3 5/5] PCI: qcom: Add support for resetting the slot due to link down event Manivannan Sadhasivam via B4 Relay
2025-04-18  2:41   ` Krishna Chaitanya Chundru
2025-04-24  5:00     ` Manivannan Sadhasivam
2025-04-24  5:11       ` Krishna Chaitanya Chundru
2025-04-24  5:27         ` Manivannan Sadhasivam
2025-05-08  6:58       ` Manivannan Sadhasivam
2025-05-05 15:05   ` Niklas Cassel [this message]
2025-05-05 16:14     ` 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=aBjTpglI5_P2Q3Aa@ryzen \
    --to=cassel@kernel.org \
    --cc=alyssa@rosenzweig.io \
    --cc=bhelgaas@google.com \
    --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=wilfred.mallawa@wdc.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).