From: Frank Li <Frank.li@oss.nxp.com>
To: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Cc: lpieralisi@kernel.org, kwilczynski@kernel.org, mani@kernel.org,
bhelgaas@google.com, linux-pci@vger.kernel.org, robh@kernel.org,
thierry.reding@kernel.org, jonathanh@nvidia.com,
kishon@kernel.org, Frank.Li@kernel.org, vidyas@nvidia.com,
cassel@kernel.org, den@valinux.co.jp, marco.crivellari@suse.com,
andriy.shevchenko@linux.intel.com, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 02/10] PCI: tegra194: Check core reset deassertion
Date: Wed, 21 Oct 2026 10:16:10 -0500 [thread overview]
Message-ID: <atjXOqLOijOiwO2c@SMW015318> (raw)
In-Reply-To: <20261021061349.1265704-3-mmaddireddy@nvidia.com>
On Wed, Oct 21, 2026 at 11:43:41AM +0530, Manikanta Maddireddy wrote:
> Several paths access DBI registers after deasserting the controller core
> reset. If reset_control_deassert() fails, those DBI accesses can trigger a
> CBB timeout, or setup can return success with the core still in reset.
>
> Check core reset deassertion in Root Port setup, the DLF retry path and the
> Endpoint PERST# deassert path. Unwind before DBI access when deassertion
> fails.
>
> Fixes: 56e15a238d92 ("PCI: tegra: Add Tegra194 PCIe support")
> Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes V1 -> V2: None
>
> drivers/pci/controller/dwc/pcie-tegra194.c | 23 +++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index 6104a22d930e..89dbef83dd9e 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -954,6 +954,7 @@ static int tegra_pcie_dw_start_link(struct dw_pcie *pci)
> struct tegra_pcie_dw *pcie = to_tegra_pcie(pci);
> struct dw_pcie_rp *pp = &pci->pp;
> u32 val, offset, tmp;
> + int ret;
> bool retry = true;
>
> if (pcie->of_data->mode == DW_PCIE_EP_TYPE) {
> @@ -1009,7 +1010,12 @@ static int tegra_pcie_dw_start_link(struct dw_pcie *pci)
> appl_writel(pcie, val, APPL_CTRL);
>
> reset_control_assert(pcie->core_rst);
> - reset_control_deassert(pcie->core_rst);
> + ret = reset_control_deassert(pcie->core_rst);
> + if (ret) {
> + dev_err(pci->dev, "Failed to deassert core reset: %d\n",
> + ret);
> + return ret;
> + }
>
> offset = dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_DLF);
> val = dw_pcie_readl_dbi(pci, offset + PCI_DLF_CAP);
> @@ -1455,10 +1461,16 @@ static int tegra_pcie_config_controller(struct tegra_pcie_dw *pcie,
> pcie->atu_dma_res->start & APPL_CFG_IATU_DMA_BASE_ADDR_MASK,
> APPL_CFG_IATU_DMA_BASE_ADDR);
>
> - reset_control_deassert(pcie->core_rst);
> + ret = reset_control_deassert(pcie->core_rst);
> + if (ret) {
> + dev_err(pcie->dev, "Failed to deassert core reset: %d\n", ret);
> + goto fail_core_rst;
> + }
>
> return ret;
>
> +fail_core_rst:
> + tegra_pcie_disable_phy(pcie);
> fail_phy:
> reset_control_assert(pcie->core_apb_rst);
> fail_core_apb_rst:
> @@ -1853,7 +1865,11 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
> LTR_NOSNOOP_MSG_REQ;
> appl_writel(pcie, val, APPL_LTR_MSG_1);
>
> - reset_control_deassert(pcie->core_rst);
> + ret = reset_control_deassert(pcie->core_rst);
> + if (ret) {
> + dev_err(dev, "Failed to deassert core reset: %d\n", ret);
> + goto fail_core_rst;
> + }
>
> /* Perform cleanup that requires refclk and core reset deasserted */
> pci_epc_deinit_notify(pcie->pci.ep.epc);
> @@ -1927,6 +1943,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
>
> fail_init_complete:
> reset_control_assert(pcie->core_rst);
> +fail_core_rst:
> tegra_pcie_disable_phy(pcie);
> fail_phy:
> reset_control_assert(pcie->core_apb_rst);
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-10-21 15:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 6:13 [PATCH v2 00/10] PCI: tegra194: Fix EP and Root Port corner cases Manikanta Maddireddy
2026-10-21 6:13 ` [PATCH v2 01/10] PCI: tegra194: Propagate REFCLK select GPIO errors Manikanta Maddireddy
2026-10-21 15:14 ` Frank Li
2026-10-21 6:13 ` [PATCH v2 02/10] PCI: tegra194: Check core reset deassertion Manikanta Maddireddy
2026-10-21 15:16 ` Frank Li [this message]
2026-10-21 6:13 ` [PATCH v2 03/10] PCI: tegra194: Fix Endpoint PERST# IRQ suspend race Manikanta Maddireddy
2026-10-21 15:19 ` Frank Li
2026-10-21 6:13 ` [PATCH v2 04/10] PCI: tegra194: Do not skip no-link Root Port remove cleanup Manikanta Maddireddy
2026-10-21 15:22 ` Frank Li
2026-10-21 6:13 ` [PATCH v2 05/10] PCI: tegra194: Check for 16 GT/s capability before programming Manikanta Maddireddy
2026-10-21 15:24 ` Frank Li
2026-10-21 6:13 ` [PATCH v2 06/10] PCI: tegra194: Check for L1SS " Manikanta Maddireddy
2026-10-21 15:28 ` Frank Li
2026-10-21 6:13 ` [PATCH v2 07/10] PCI: tegra194: Always disable Tegra234 Endpoint L1.2 Manikanta Maddireddy
2026-10-21 15:32 ` Frank Li
2026-10-21 6:13 ` [PATCH v2 08/10] PCI: tegra194: Guard Endpoint PLL-off error path Manikanta Maddireddy
2026-10-21 15:36 ` Frank Li
2026-10-21 6:13 ` [PATCH v2 09/10] PCI: tegra194: Balance core monitor clock on failures Manikanta Maddireddy
2026-10-21 15:43 ` Frank Li
2026-10-21 6:13 ` [PATCH v2 10/10] PCI: tegra194: Reject zero MSI interrupt number Manikanta Maddireddy
2026-10-21 15:44 ` Frank Li
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=atjXOqLOijOiwO2c@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=den@valinux.co.jp \
--cc=jonathanh@nvidia.com \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=marco.crivellari@suse.com \
--cc=mmaddireddy@nvidia.com \
--cc=robh@kernel.org \
--cc=thierry.reding@kernel.org \
--cc=vidyas@nvidia.com \
/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
all inboxes | Powered by JetHome®