Skip to content

Commit f38e0c5

Browse files
Vidya Sagargregkh
authored andcommitted
PCI: tegra194: Fix polling delay for L2 state
[ Upstream commit adaffed ] As per PCIe r7.0, sec 5.3.3.2.1, after sending PME_Turn_Off message, Root Port should wait for 1-10 msec for PME_TO_Ack message. Currently, driver is polling for 10 msec with 1 usec delay which is aggressive. Use existing macro PCIE_PME_TO_L2_TIMEOUT_US to poll for 10 msec with 1 msec delay. Since this function is used in non-atomic context only, use non-atomic poll function. Fixes: 56e15a2 ("PCI: tegra: Add Tegra194 PCIe support") Signed-off-by: Vidya Sagar <vidyas@nvidia.com> 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> Link: https://patch.msgid.link/20260324190755.1094879-2-mmaddireddy@nvidia.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent feac3db commit f38e0c5

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@
198198
#define CAP_SPCIE_CAP_OFF_USP_TX_PRESET0_MASK GENMASK(11, 8)
199199
#define CAP_SPCIE_CAP_OFF_USP_TX_PRESET0_SHIFT 8
200200

201-
#define PME_ACK_TIMEOUT 10000
202-
203201
#define LTSSM_TIMEOUT 50000 /* 50ms */
204202

205203
#define GEN3_GEN4_EQ_PRESET_INIT 5
@@ -1582,9 +1580,10 @@ static int tegra_pcie_try_link_l2(struct tegra_pcie_dw *pcie)
15821580
val |= APPL_PM_XMT_TURNOFF_STATE;
15831581
appl_writel(pcie, val, APPL_RADM_STATUS);
15841582

1585-
return readl_poll_timeout_atomic(pcie->appl_base + APPL_DEBUG, val,
1586-
val & APPL_DEBUG_PM_LINKST_IN_L2_LAT,
1587-
1, PME_ACK_TIMEOUT);
1583+
return readl_poll_timeout(pcie->appl_base + APPL_DEBUG, val,
1584+
val & APPL_DEBUG_PM_LINKST_IN_L2_LAT,
1585+
PCIE_PME_TO_L2_TIMEOUT_US/10,
1586+
PCIE_PME_TO_L2_TIMEOUT_US);
15881587
}
15891588

15901589
static void tegra_pcie_dw_pme_turnoff(struct tegra_pcie_dw *pcie)

0 commit comments

Comments
 (0)