Skip to content

Commit 34b3eef

Browse files
Manikanta Maddireddybjorn-helgaas
authored andcommitted
PCI: tegra194: Fix CBB timeout caused by DBI access before core power-on
When PERST# is deasserted twice (assert -> deassert -> assert -> deassert), a CBB (Control Backbone) timeout occurs at DBI register offset 0x8bc (PCIE_MISC_CONTROL_1_OFF). This happens because pci_epc_deinit_notify() and dw_pcie_ep_cleanup() are called before reset_control_deassert() powers on the controller core. The call chain that causes the timeout: pex_ep_event_pex_rst_deassert() pci_epc_deinit_notify() pci_epf_test_epc_deinit() pci_epf_test_clear_bar() pci_epc_clear_bar() dw_pcie_ep_clear_bar() __dw_pcie_ep_reset_bar() dw_pcie_dbi_ro_wr_en() <- Accesses 0x8bc DBI register reset_control_deassert(pcie->core_rst) <- Core powered on HERE The DBI registers, including PCIE_MISC_CONTROL_1_OFF (0x8bc), are only accessible after the controller core is powered on via reset_control_deassert(pcie->core_rst). Accessing them before this point results in a CBB timeout because the hardware is not yet operational. Fix this by moving pci_epc_deinit_notify() and dw_pcie_ep_cleanup() to after reset_control_deassert(pcie->core_rst), ensuring the controller is fully powered on before any DBI register accesses occur. Fixes: 40e2125 ("PCI: tegra194: Move controller cleanups to pex_ep_event_pex_rst_deassert()") Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Vidya Sagar <vidyas@nvidia.com> Link: https://patch.msgid.link/20260324190755.1094879-15-mmaddireddy@nvidia.com
1 parent f59df1d commit 34b3eef

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/pci/controller/dwc/pcie-tegra194.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,10 +1750,6 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
17501750
goto fail_phy;
17511751
}
17521752

1753-
/* Perform cleanup that requires refclk */
1754-
pci_epc_deinit_notify(pcie->pci.ep.epc);
1755-
dw_pcie_ep_cleanup(&pcie->pci.ep);
1756-
17571753
/* Clear any stale interrupt statuses */
17581754
appl_writel(pcie, 0xFFFFFFFF, APPL_INTR_STATUS_L0);
17591755
appl_writel(pcie, 0xFFFFFFFF, APPL_INTR_STATUS_L1_0_0);
@@ -1823,6 +1819,10 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
18231819

18241820
reset_control_deassert(pcie->core_rst);
18251821

1822+
/* Perform cleanup that requires refclk and core reset deasserted */
1823+
pci_epc_deinit_notify(pcie->pci.ep.epc);
1824+
dw_pcie_ep_cleanup(&pcie->pci.ep);
1825+
18261826
val = dw_pcie_readl_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL);
18271827
val &= ~PORT_LOGIC_SPEED_CHANGE;
18281828
dw_pcie_writel_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL, val);

0 commit comments

Comments
 (0)