From: sashiko-bot@kernel.org
To: hongxing.zhu@oss.nxp.com
Cc: Frank.Li@kernel.org, imx@lists.linux.dev, linux-pci@vger.kernel.org
Subject: Re: [PATCH v1] PCI: imx6: Fix i.MX6Q/DL boot hang by separating PHY power and reference clock control
Date: Mon, 06 Jul 2026 03:18:57 +0000 [thread overview]
Message-ID: <20260706031858.3BB1F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706030629.3264320-1-hongxing.zhu@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] PCIe PHY remains powered up on probe error paths
--
commit a734b2214ed3f695bc7968ca2438d6c116ff54b7
Author: Richard Zhu <hongxing.zhu@nxp.com>
PCI: imx6: Fix i.MX6Q/DL boot hang by separating PHY power and reference clock control
Commit 610fa91d9863 ("PCI: imx6: Assert PERST# before enabling regulators")
introduced a boot hang on i.MX6Q/DL variants by changing the initialization
sequence.
The issue stems from coupling PHY power (TEST_PD) and reference clock
(REF_CLK_EN) control in imx6q_pcie_enable_ref_clk(). When these are
managed together, the timing between PHY power-up and reference clock
enablement cannot be properly controlled, leading to initialization
failures.
[ ... ]
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 98e1db751132a..ab74f03f70bc8 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -680,21 +680,12 @@ static int imx_pcie_attach_pd(struct device *dev)
>
> static int imx6q_pcie_enable_ref_clk(struct imx_pcie *imx_pcie, bool enable)
> {
> - if (enable) {
> - /* power up core phy and enable ref clock */
> - regmap_clear_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_TEST_PD);
[ ... ]
> - } else {
> - regmap_clear_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_REF_CLK_EN);
> - regmap_set_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_TEST_PD);
> - }
> + if (enable)
> + regmap_set_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR1,
> + IMX6Q_GPR1_PCIE_REF_CLK_EN);
> + else
> + regmap_clear_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR1,
> + IMX6Q_GPR1_PCIE_REF_CLK_EN);
>
> return 0;
> }
[Severity: Medium]
When TEST_PD is no longer asserted here, does this cause a power leak
during probe failure or driver removal?
Because imx_pcie_clk_disable() indirectly calls this function with
enable=false, it used to power down the PHY by asserting TEST_PD. After
this change, error paths only disable the clock but leave the PHY powered up:
drivers/pci/controller/dwc/pci-imx6.c:imx_pcie_host_init() {
...
imx_pcie_deassert_core_reset(imx_pcie);
...
if (imx_pcie->drvdata->wait_pll_lock) {
ret = imx_pcie->drvdata->wait_pll_lock(imx_pcie);
if (ret < 0)
goto err_phy_off;
}
...
err_clk_disable:
imx_pcie_clk_disable(imx_pcie);
...
}
The same applies to imx_pcie_host_exit() which calls imx_pcie_clk_disable()
during teardown.
Should imx_pcie_assert_core_reset() be explicitly called in
imx_pcie_host_init()'s error path (and in imx_pcie_host_exit()) to ensure
the PHY is properly powered down and reset?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706030629.3264320-1-hongxing.zhu@oss.nxp.com?part=1
next prev parent reply other threads:[~2026-07-06 3:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 3:06 [PATCH v1] PCI: imx6: Fix i.MX6Q/DL boot hang by separating PHY power and reference clock control hongxing.zhu
2026-07-06 3:18 ` sashiko-bot [this message]
2026-07-06 14:08 ` Soeren Moch
2026-07-07 3:03 ` Hongxing Zhu (OSS)
2026-07-07 6:22 ` Francesco Dolcini
2026-07-07 6:31 ` Hongxing Zhu (OSS)
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=20260706031858.3BB1F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=hongxing.zhu@oss.nxp.com \
--cc=imx@lists.linux.dev \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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