* [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior
@ 2025-07-09 3:37 Richard Zhu
2025-07-09 3:37 ` [PATCH v4 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Richard Zhu @ 2025-07-09 3:37 UTC (permalink / raw)
To: frank.li, l.stach, lpieralisi, kwilczynski, mani, robh, bhelgaas,
shawnguo, s.hauer, kernel, festevam
Cc: linux-pci, linux-arm-kernel, imx, linux-kernel
apps_reset is LTSSM_EN on i.MX7, i.MX8MQ, i.MX8MM and i.MX8MP platforms.
Since the assertion/de-assertion of apps_reset(LTSSM_EN bit) had been
wrappered in imx_pcie_ltssm_enable() and imx_pcie_ltssm_disable();
Remove apps_reset toggle in imx_pcie_assert_core_reset() and
imx_pcie_deassert_core_reset() functions. Use imx_pcie_ltssm_enable()
and imx_pcie_ltssm_disable() to configure apps_reset directly.
Fix fail[1] to enumerate reliably PI7C9X2G608GP (hotplug) at i.MX8MM,
which reported By Tim.
Main changes in v4:
- Update commit message and add Tested-by tag in the first patch, and
add Fixes tag into the second one.
v3: https://patchwork.kernel.org/project/linux-pci/cover/20250616085742.2684742-1-hongxing.zhu@nxp.com/
Main changes in v3:
- Correct the email address of Mani and Krzysztof Wilczyński.
- Add "Reviewed-by: Frank Li <Frank.Li@nxp.com>" tag, and rebase to v6.16-rc2
v2: https://patchwork.kernel.org/project/linux-pci/cover/20250612022747.1206053-1-hongxing.zhu@nxp.com/
Main changes in v2:
- Respin "PCI: imx6: Align EP link start behavior with" patch.
- Add the apps_reset refine patch into this patch-set.
v1: https://patchwork.kernel.org/project/linux-pci/patch/20250606075729.3855815-1-hongxing.zhu@nxp.com/
[1]https://lore.kernel.org/all/CAJ+vNU3ohR2YKTwC4xoYrc1z-neDoH2TTZcMHDy+poj9=jSy+w@mail.gmail.com/
[PATCH v4 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset
[PATCH v4 2/2] PCI: imx6: Align EP link start behavior with
drivers/pci/controller/dwc/pci-imx6.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v4 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions
2025-07-09 3:37 [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior Richard Zhu
@ 2025-07-09 3:37 ` Richard Zhu
2025-07-09 3:37 ` [PATCH v4 2/2] PCI: imx6: Align EP link start behavior with documentation Richard Zhu
2025-07-23 15:57 ` [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Richard Zhu @ 2025-07-09 3:37 UTC (permalink / raw)
To: frank.li, l.stach, lpieralisi, kwilczynski, mani, robh, bhelgaas,
shawnguo, s.hauer, kernel, festevam
Cc: linux-pci, linux-arm-kernel, imx, linux-kernel, Richard Zhu,
Tim Harvey, stable, Frank Li
apps_reset is LTSSM_EN on i.MX7, i.MX8MQ, i.MX8MM and i.MX8MP platforms.
Since the assertion/de-assertion of apps_reset(LTSSM_EN bit) had been
wrappered in imx_pcie_ltssm_enable() and imx_pcie_ltssm_disable();
Remove apps_reset toggle in imx_pcie_assert_core_reset() and
imx_pcie_deassert_core_reset() functions. Use imx_pcie_ltssm_enable()
and imx_pcie_ltssm_disable() to configure apps_reset directly.
Fix fail to enumerate reliably PI7C9X2G608GP (hotplug) at i.MX8MM, which
reported By Tim.
Only i.MX7D, i.MX8MQ, i.MX8MM, and i.MX8MP have the apps_reset. With
this change, the assertion/deassertion of LTSSM_EN bit are unified into
imx_pcie_ltssm_enable() and imx_pcie_ltssm_disable() functions, and
aligned with other i.MX platforms.
Reported-by: Tim Harvey <tharvey@gateworks.com>
Closes: https://lore.kernel.org/all/CAJ+vNU3ohR2YKTwC4xoYrc1z-neDoH2TTZcMHDy+poj9=jSy+w@mail.gmail.com/
Fixes: ef61c7d8d032 ("PCI: imx6: Deassert apps_reset in imx_pcie_deassert_core_reset()")
Cc: stable@vger.kernel.org
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Tim Harvey <tharvey@gateworks.com> # imx8mp-venice-gw74xx (i.MX8MP + hotplug capable switch)
---
drivers/pci/controller/dwc/pci-imx6.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 9754cc6e09b9..f5f2ac638f4b 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -860,7 +860,6 @@ static int imx95_pcie_core_reset(struct imx_pcie *imx_pcie, bool assert)
static void imx_pcie_assert_core_reset(struct imx_pcie *imx_pcie)
{
reset_control_assert(imx_pcie->pciephy_reset);
- reset_control_assert(imx_pcie->apps_reset);
if (imx_pcie->drvdata->core_reset)
imx_pcie->drvdata->core_reset(imx_pcie, true);
@@ -872,7 +871,6 @@ static void imx_pcie_assert_core_reset(struct imx_pcie *imx_pcie)
static int imx_pcie_deassert_core_reset(struct imx_pcie *imx_pcie)
{
reset_control_deassert(imx_pcie->pciephy_reset);
- reset_control_deassert(imx_pcie->apps_reset);
if (imx_pcie->drvdata->core_reset)
imx_pcie->drvdata->core_reset(imx_pcie, false);
@@ -1247,6 +1245,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
}
}
+ /* Make sure that PCIe LTSSM is cleared */
+ imx_pcie_ltssm_disable(dev);
+
ret = imx_pcie_deassert_core_reset(imx_pcie);
if (ret < 0) {
dev_err(dev, "pcie deassert core reset failed: %d\n", ret);
--
2.37.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v4 2/2] PCI: imx6: Align EP link start behavior with documentation
2025-07-09 3:37 [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior Richard Zhu
2025-07-09 3:37 ` [PATCH v4 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
@ 2025-07-09 3:37 ` Richard Zhu
2025-07-23 15:57 ` [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Richard Zhu @ 2025-07-09 3:37 UTC (permalink / raw)
To: frank.li, l.stach, lpieralisi, kwilczynski, mani, robh, bhelgaas,
shawnguo, s.hauer, kernel, festevam
Cc: linux-pci, linux-arm-kernel, imx, linux-kernel, Richard Zhu,
stable, Frank Li
According to PCI/endpoint/pci-endpoint-cfs.rst, the endpoint (EP) should
only link up after `echo 1 > start` is executed.
To match the documented behavior, do not start the link automatically
when adding the EP controller.
Fixes: 75c2f26da03f ("PCI: imx6: Add i.MX PCIe EP mode support")
Cc: stable@vger.kernel.org
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---
drivers/pci/controller/dwc/pci-imx6.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index f5f2ac638f4b..fda03512944d 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -1468,9 +1468,6 @@ static int imx_add_pcie_ep(struct imx_pcie *imx_pcie,
pci_epc_init_notify(ep->epc);
- /* Start LTSSM. */
- imx_pcie_ltssm_enable(dev);
-
return 0;
}
--
2.37.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior
2025-07-09 3:37 [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior Richard Zhu
2025-07-09 3:37 ` [PATCH v4 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
2025-07-09 3:37 ` [PATCH v4 2/2] PCI: imx6: Align EP link start behavior with documentation Richard Zhu
@ 2025-07-23 15:57 ` Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2025-07-23 15:57 UTC (permalink / raw)
To: frank.li, l.stach, lpieralisi, kwilczynski, robh, bhelgaas,
shawnguo, s.hauer, kernel, festevam, Richard Zhu
Cc: linux-pci, linux-arm-kernel, imx, linux-kernel
On Wed, 09 Jul 2025 11:37:20 +0800, Richard Zhu wrote:
> apps_reset is LTSSM_EN on i.MX7, i.MX8MQ, i.MX8MM and i.MX8MP platforms.
> Since the assertion/de-assertion of apps_reset(LTSSM_EN bit) had been
> wrappered in imx_pcie_ltssm_enable() and imx_pcie_ltssm_disable();
>
> Remove apps_reset toggle in imx_pcie_assert_core_reset() and
> imx_pcie_deassert_core_reset() functions. Use imx_pcie_ltssm_enable()
> and imx_pcie_ltssm_disable() to configure apps_reset directly.
>
> [...]
Applied, thanks!
[1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions
commit: 315b747ae6b07ffabb27ed8ca584e6e6df8050a5
[2/2] PCI: imx6: Align EP link start behavior with documentation
commit: a43b68bc510aa61a5b7618c79784dbc83074e504
Best regards,
--
Manivannan Sadhasivam <mani@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-23 16:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 3:37 [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior Richard Zhu
2025-07-09 3:37 ` [PATCH v4 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
2025-07-09 3:37 ` [PATCH v4 2/2] PCI: imx6: Align EP link start behavior with documentation Richard Zhu
2025-07-23 15:57 ` [PATCH v4 0/2] PCI: imx6: Refine apps_reset and EP link behavior Manivannan Sadhasivam
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).