linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v3 0/2] PCI: imx6: Refine apps_reset and EP link behavior
@ 2025-06-16  8:57 Richard Zhu
  2025-06-16  8:57 ` [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
  2025-06-16  8:57 ` [PATCH v3 2/2] PCI: imx6: Align EP link start behavior with documentation Richard Zhu
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Zhu @ 2025-06-16  8:57 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 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 v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset
[PATCH v3 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] 9+ messages in thread

* [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions
  2025-06-16  8:57 [v3 0/2] PCI: imx6: Refine apps_reset and EP link behavior Richard Zhu
@ 2025-06-16  8:57 ` Richard Zhu
  2025-06-20 16:12   ` Tim Harvey
  2025-06-23 11:42   ` Manivannan Sadhasivam
  2025-06-16  8:57 ` [PATCH v3 2/2] PCI: imx6: Align EP link start behavior with documentation Richard Zhu
  1 sibling, 2 replies; 9+ messages in thread
From: Richard Zhu @ 2025-06-16  8:57 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, 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.

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()")
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---
 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] 9+ messages in thread

* [PATCH v3 2/2] PCI: imx6: Align EP link start behavior with documentation
  2025-06-16  8:57 [v3 0/2] PCI: imx6: Refine apps_reset and EP link behavior Richard Zhu
  2025-06-16  8:57 ` [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
@ 2025-06-16  8:57 ` Richard Zhu
  2025-07-08  7:47   ` Manivannan Sadhasivam
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Zhu @ 2025-06-16  8:57 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,
	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.

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] 9+ messages in thread

* Re: [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions
  2025-06-16  8:57 ` [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
@ 2025-06-20 16:12   ` Tim Harvey
  2025-06-23 11:42   ` Manivannan Sadhasivam
  1 sibling, 0 replies; 9+ messages in thread
From: Tim Harvey @ 2025-06-20 16:12 UTC (permalink / raw)
  To: Richard Zhu
  Cc: frank.li, l.stach, lpieralisi, kwilczynski, mani, robh, bhelgaas,
	shawnguo, s.hauer, kernel, festevam, linux-pci, linux-arm-kernel,
	imx, linux-kernel

On Mon, Jun 16, 2025 at 1:59 AM Richard Zhu <hongxing.zhu@nxp.com> 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.
>
> Fix fail to enumerate reliably PI7C9X2G608GP (hotplug) at i.MX8MM, which
> reported By Tim.
>
> 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()")
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
>  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
>

Tested-by: Tim Harvey <tharvey@gateworks.com> # imx8mp-venice-gw74xx
(i.MX8MP + hotplug capable switch)

Best Regards,

Tim

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions
  2025-06-16  8:57 ` [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
  2025-06-20 16:12   ` Tim Harvey
@ 2025-06-23 11:42   ` Manivannan Sadhasivam
  2025-06-23 17:33     ` Tim Harvey
  1 sibling, 1 reply; 9+ messages in thread
From: Manivannan Sadhasivam @ 2025-06-23 11:42 UTC (permalink / raw)
  To: Richard Zhu
  Cc: frank.li, l.stach, lpieralisi, kwilczynski, robh, bhelgaas,
	shawnguo, s.hauer, kernel, festevam, linux-pci, linux-arm-kernel,
	imx, linux-kernel, Tim Harvey

On Mon, Jun 16, 2025 at 04:57:41PM +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();
> 

What about other i.MX chipsets like 6Q and its cousins? Wouldn't this change
affect them since they treat 'apps_reset' differently?

- Mani

> 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.
> 
> 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()")
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
>  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	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions
  2025-06-23 11:42   ` Manivannan Sadhasivam
@ 2025-06-23 17:33     ` Tim Harvey
  2025-07-08  2:37       ` Hongxing Zhu
  0 siblings, 1 reply; 9+ messages in thread
From: Tim Harvey @ 2025-06-23 17:33 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: Richard Zhu, frank.li, l.stach, lpieralisi, kwilczynski, robh,
	bhelgaas, shawnguo, s.hauer, kernel, festevam, linux-pci,
	linux-arm-kernel, imx, linux-kernel

On Mon, Jun 23, 2025 at 4:42 AM Manivannan Sadhasivam <mani@kernel.org> wrote:
>
> On Mon, Jun 16, 2025 at 04:57:41PM +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();
> >
>
> What about other i.MX chipsets like 6Q and its cousins? Wouldn't this change
> affect them since they treat 'apps_reset' differently?
>
> - Mani

Hi Main,

This patch effectively brings back the behavior prior to commit
ef61c7d8d032 ("PCI: imx6: Deassert apps_reset in
imx_pcie_deassert_core_reset()") which caused the original
regressions.

To ease your concerns I've tested this patch on top of v6.16-rc3 with
the following IMX6 boards I have here with and without a PCI device
attached:
imx6q-gw51xx - no switch
imx6q-gw54xx - switch

I only have imx6qdl/imx8mm/imx8mp boards to test with.

From what I can tell it doesn't look like the original patch that
added the 'symmetric' apps_reset de-assert was necessarily well
tested. It started out being added because as far as I can tell it
'looked' like the right thing to do [1]. You requested changes to the
commit log for wording [2],[3] but I'm unclear that anyone tested
this.

Best Regards,

Tim
[1] https://patchwork.kernel.org/project/linux-pci/patch/1727148464-14341-6-git-send-email-hongxing.zhu@nxp.com/
[2] https://patchwork.kernel.org/project/linux-pci/patch/1728981213-8771-6-git-send-email-hongxing.zhu@nxp.com/
[3] https://patchwork.kernel.org/project/linux-pci/patch/20241101070610.1267391-6-hongxing.zhu@nxp.com/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions
  2025-06-23 17:33     ` Tim Harvey
@ 2025-07-08  2:37       ` Hongxing Zhu
  2025-07-08  7:47         ` Manivannan Sadhasivam
  0 siblings, 1 reply; 9+ messages in thread
From: Hongxing Zhu @ 2025-07-08  2:37 UTC (permalink / raw)
  To: tharvey@gateworks.com, Manivannan Sadhasivam
  Cc: Frank Li, l.stach@pengutronix.de, lpieralisi@kernel.org,
	kwilczynski@kernel.org, robh@kernel.org, bhelgaas@google.com,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	imx@lists.linux.dev, linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Tim Harvey <tharvey@gateworks.com>
> Sent: 2025年6月24日 1:33
> To: Manivannan Sadhasivam <mani@kernel.org>
> Cc: Hongxing Zhu <hongxing.zhu@nxp.com>; Frank Li <frank.li@nxp.com>;
> l.stach@pengutronix.de; lpieralisi@kernel.org; kwilczynski@kernel.org;
> robh@kernel.org; bhelgaas@google.com; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> imx@lists.linux.dev; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in
> _core_reset functions
> 
> On Mon, Jun 23, 2025 at 4:42 AM Manivannan Sadhasivam <mani@kernel.org>
> wrote:
> >
> > On Mon, Jun 16, 2025 at 04:57:41PM +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();
> > >
> >
> > What about other i.MX chipsets like 6Q and its cousins? Wouldn't this
> > change affect them since they treat 'apps_reset' differently?
> >
> > - Mani

Hi Mani:
Sorry to reply late.
Only i.MX7D, i.MX8MQ, i.MX8MM, and i.MX8MP have the apps_reset. No problems
are found with this change in my local tests on these four platforms.
With this change, the assertion/deassertion of ltssm_en bit are unified into
 imx_pcie_ltssm_enable() and imx_pcie_ltssm_disable() functions, aligned with
other i.MX platforms.

Best Regards
Richard Zhu
> 
> Hi Main,
> 
> This patch effectively brings back the behavior prior to commit
> ef61c7d8d032 ("PCI: imx6: Deassert apps_reset in
> imx_pcie_deassert_core_reset()") which caused the original regressions.
> 
> To ease your concerns I've tested this patch on top of v6.16-rc3 with the
> following IMX6 boards I have here with and without a PCI device
> attached:
> imx6q-gw51xx - no switch
> imx6q-gw54xx - switch
> 
> I only have imx6qdl/imx8mm/imx8mp boards to test with.
> 
> From what I can tell it doesn't look like the original patch that added the
> 'symmetric' apps_reset de-assert was necessarily well tested. It started out
> being added because as far as I can tell it 'looked' like the right thing to do [1].
> You requested changes to the commit log for wording [2],[3] but I'm unclear
> that anyone tested this.
>
Hi Tim: 
Thanks for your explains and tests.

Best Regards
Richard Zhu

> Best Regards,
> 
> Tim
> [1]
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.kernel.org%2Fproject%2Flinux-pci%2Fpatch%2F1727148464-14341-6-gi
> t-send-email-hongxing.zhu%40nxp.com%2F&data=05%7C02%7Chongxing.zhu
> %40nxp.com%7Cdac60212c1c94cb24d7508ddb27c0f92%7C686ea1d3bc2b4c
> 6fa92cd99c5c301635%7C0%7C0%7C638862968081967795%7CUnknown%7
> CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJ
> XaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=8I
> 7qGI92BfsbAERknsVjZO6cI527Enxgiiw%2FVatI7h4%3D&reserved=0
> [2]
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.kernel.org%2Fproject%2Flinux-pci%2Fpatch%2F1728981213-8771-6-git
> -send-email-hongxing.zhu%40nxp.com%2F&data=05%7C02%7Chongxing.zhu
> %40nxp.com%7Cdac60212c1c94cb24d7508ddb27c0f92%7C686ea1d3bc2b4c
> 6fa92cd99c5c301635%7C0%7C0%7C638862968081993466%7CUnknown%7
> CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJ
> XaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=lh
> ER8F9ApfpgQcVCyMOBYho%2BXvlp79re4jX5C5gj1XY%3D&reserved=0
> [3]
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.kernel.org%2Fproject%2Flinux-pci%2Fpatch%2F20241101070610.1267
> 391-6-hongxing.zhu%40nxp.com%2F&data=05%7C02%7Chongxing.zhu%40nx
> p.com%7Cdac60212c1c94cb24d7508ddb27c0f92%7C686ea1d3bc2b4c6fa92c
> d99c5c301635%7C0%7C0%7C638862968082007982%7CUnknown%7CTWFp
> bGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4z
> MiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=kp4EqnV
> lfUsVq4k9UV33LSpiwn%2F2OJlPzu2PApAttNs%3D&reserved=0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions
  2025-07-08  2:37       ` Hongxing Zhu
@ 2025-07-08  7:47         ` Manivannan Sadhasivam
  0 siblings, 0 replies; 9+ messages in thread
From: Manivannan Sadhasivam @ 2025-07-08  7:47 UTC (permalink / raw)
  To: Hongxing Zhu
  Cc: tharvey@gateworks.com, Frank Li, l.stach@pengutronix.de,
	lpieralisi@kernel.org, kwilczynski@kernel.org, robh@kernel.org,
	bhelgaas@google.com, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	imx@lists.linux.dev, linux-kernel@vger.kernel.org

On Tue, Jul 08, 2025 at 02:37:00AM GMT, Hongxing Zhu wrote:
> > -----Original Message-----
> > From: Tim Harvey <tharvey@gateworks.com>
> > Sent: 2025年6月24日 1:33
> > To: Manivannan Sadhasivam <mani@kernel.org>
> > Cc: Hongxing Zhu <hongxing.zhu@nxp.com>; Frank Li <frank.li@nxp.com>;
> > l.stach@pengutronix.de; lpieralisi@kernel.org; kwilczynski@kernel.org;
> > robh@kernel.org; bhelgaas@google.com; shawnguo@kernel.org;
> > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> > imx@lists.linux.dev; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in
> > _core_reset functions
> > 
> > On Mon, Jun 23, 2025 at 4:42 AM Manivannan Sadhasivam <mani@kernel.org>
> > wrote:
> > >
> > > On Mon, Jun 16, 2025 at 04:57:41PM +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();
> > > >
> > >
> > > What about other i.MX chipsets like 6Q and its cousins? Wouldn't this
> > > change affect them since they treat 'apps_reset' differently?
> > >
> > > - Mani
> 
> Hi Mani:
> Sorry to reply late.
> Only i.MX7D, i.MX8MQ, i.MX8MM, and i.MX8MP have the apps_reset. No problems
> are found with this change in my local tests on these four platforms.
> With this change, the assertion/deassertion of ltssm_en bit are unified into
>  imx_pcie_ltssm_enable() and imx_pcie_ltssm_disable() functions, aligned with
> other i.MX platforms.
> 

Okay, thanks for clarifying. Please include this information in the commit
message as well and also CC stable list for backporting since it fixes a bug.

- Mani

> Best Regards
> Richard Zhu
> > 
> > Hi Main,
> > 
> > This patch effectively brings back the behavior prior to commit
> > ef61c7d8d032 ("PCI: imx6: Deassert apps_reset in
> > imx_pcie_deassert_core_reset()") which caused the original regressions.
> > 
> > To ease your concerns I've tested this patch on top of v6.16-rc3 with the
> > following IMX6 boards I have here with and without a PCI device
> > attached:
> > imx6q-gw51xx - no switch
> > imx6q-gw54xx - switch
> > 
> > I only have imx6qdl/imx8mm/imx8mp boards to test with.
> > 
> > From what I can tell it doesn't look like the original patch that added the
> > 'symmetric' apps_reset de-assert was necessarily well tested. It started out
> > being added because as far as I can tell it 'looked' like the right thing to do [1].
> > You requested changes to the commit log for wording [2],[3] but I'm unclear
> > that anyone tested this.
> >
> Hi Tim: 
> Thanks for your explains and tests.
> 
> Best Regards
> Richard Zhu
> 
> > Best Regards,
> > 
> > Tim
> > [1]
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> > work.kernel.org%2Fproject%2Flinux-pci%2Fpatch%2F1727148464-14341-6-gi
> > t-send-email-hongxing.zhu%40nxp.com%2F&data=05%7C02%7Chongxing.zhu
> > %40nxp.com%7Cdac60212c1c94cb24d7508ddb27c0f92%7C686ea1d3bc2b4c
> > 6fa92cd99c5c301635%7C0%7C0%7C638862968081967795%7CUnknown%7
> > CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJ
> > XaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=8I
> > 7qGI92BfsbAERknsVjZO6cI527Enxgiiw%2FVatI7h4%3D&reserved=0
> > [2]
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> > work.kernel.org%2Fproject%2Flinux-pci%2Fpatch%2F1728981213-8771-6-git
> > -send-email-hongxing.zhu%40nxp.com%2F&data=05%7C02%7Chongxing.zhu
> > %40nxp.com%7Cdac60212c1c94cb24d7508ddb27c0f92%7C686ea1d3bc2b4c
> > 6fa92cd99c5c301635%7C0%7C0%7C638862968081993466%7CUnknown%7
> > CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJ
> > XaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=lh
> > ER8F9ApfpgQcVCyMOBYho%2BXvlp79re4jX5C5gj1XY%3D&reserved=0
> > [3]
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> > work.kernel.org%2Fproject%2Flinux-pci%2Fpatch%2F20241101070610.1267
> > 391-6-hongxing.zhu%40nxp.com%2F&data=05%7C02%7Chongxing.zhu%40nx
> > p.com%7Cdac60212c1c94cb24d7508ddb27c0f92%7C686ea1d3bc2b4c6fa92c
> > d99c5c301635%7C0%7C0%7C638862968082007982%7CUnknown%7CTWFp
> > bGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4z
> > MiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=kp4EqnV
> > lfUsVq4k9UV33LSpiwn%2F2OJlPzu2PApAttNs%3D&reserved=0

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 2/2] PCI: imx6: Align EP link start behavior with documentation
  2025-06-16  8:57 ` [PATCH v3 2/2] PCI: imx6: Align EP link start behavior with documentation Richard Zhu
@ 2025-07-08  7:47   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 9+ messages in thread
From: Manivannan Sadhasivam @ 2025-07-08  7:47 UTC (permalink / raw)
  To: Richard Zhu
  Cc: frank.li, l.stach, lpieralisi, kwilczynski, robh, bhelgaas,
	shawnguo, s.hauer, kernel, festevam, linux-pci, linux-arm-kernel,
	imx, linux-kernel

On Mon, Jun 16, 2025 at 04:57:42PM GMT, Richard Zhu wrote:
> 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.
> 
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>

Fixes tag?

- Mani

> 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	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-07-08  7:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-16  8:57 [v3 0/2] PCI: imx6: Refine apps_reset and EP link behavior Richard Zhu
2025-06-16  8:57 ` [PATCH v3 1/2] PCI: imx6: Remove apps_reset toggle in _core_reset functions Richard Zhu
2025-06-20 16:12   ` Tim Harvey
2025-06-23 11:42   ` Manivannan Sadhasivam
2025-06-23 17:33     ` Tim Harvey
2025-07-08  2:37       ` Hongxing Zhu
2025-07-08  7:47         ` Manivannan Sadhasivam
2025-06-16  8:57 ` [PATCH v3 2/2] PCI: imx6: Align EP link start behavior with documentation Richard Zhu
2025-07-08  7:47   ` 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).