From: sashiko-bot@kernel.org
To: hongxing.zhu@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v3] PCI: imx6: Fix i.MX6Q/DL boot hang caused by improper PHY power sequencing
Date: Wed, 22 Jul 2026 03:20:19 +0000 [thread overview]
Message-ID: <20260722032019.E70091F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722030935.2328278-1-hongxing.zhu@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The removal of explicit PHY power-up delays causes a boot regression on boards without a PERST# GPIO or explicit Root Port nodes in the device tree.
- [Medium] Incorrect teardown ordering in `imx_pcie_host_exit()` violates LIFO symmetry by asserting the core reset after the PHY is powered off and exited.
--
--- Patch [1]: [PATCH v3] PCI: imx6: Fix i.MX6Q/DL boot hang caused by improper PHY power sequencing ---
commit 00ce7804e098bc0e8573a15a850f6250a9cb1245
Author: Richard Zhu <hongxing.zhu@nxp.com>
PCI: imx6: Fix i.MX6Q/DL boot hang caused by improper PHY power sequencing
This commit fixes a boot hang on i.MX6Q/DL variants by correcting the PHY power
sequencing and TEST_PD control logic. It removes an explicit delay during clock
enable, assuming the PERST# toggling sequence provides sufficient stabilization
time. It also adds explicit core reset assertions in the error paths.
Link: https://lore.kernel.org/lkml/20260629143439.361560-1-leoreis.costa@gmail.com/
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index e25f938eefe23..45ab21c9769a4 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -681,21 +681,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);
> - /*
> - * The async reset input need ref clock to sync internally,
> - * when the ref clock comes after reset, internal synced
> - * reset time is too short, cannot meet the requirement.
> - * Add a ~10us delay here.
> - */
> - usleep_range(10, 100);
[Severity: High]
The commit message states that the ~120us delay needed between TEST_PD
de-assertion and link training is satisfied by the PERST# toggling sequence.
Does this break boards that don't define a reset GPIO (like
imx6qdl-sabrelite.dtsi)?
If the device tree lacks a PERST# GPIO or explicit Root Port nodes,
imx_pcie_assert_perst() returns immediately:
static void imx_pcie_assert_perst(struct imx_pcie *imx_pcie, bool assert)
{
[ ... ]
if (!bridge || list_empty(&bridge->ports))
return;
[ ... ]
}
Because of this early return, there will be no delay before link training
begins in imx_pcie_host_init(). Could this lead to a boot hang on these
boards due to the missing PHY stabilization delay?
[ ... ]
> @@ -1475,6 +1467,7 @@ static void imx_pcie_host_exit(struct dw_pcie_rp *pp)
> if (phy_power_off(imx_pcie->phy))
> dev_err(pci->dev, "unable to power off PHY\n");
> phy_exit(imx_pcie->phy);
> }
> + imx_pcie_assert_core_reset(imx_pcie);
[Severity: Medium]
Is the teardown ordering correct here?
During initialization, the core reset is asserted before powering on the PHY.
The error path err_phy_off in imx_pcie_host_init() correctly mirrors this
by asserting the core reset before powering off the PHY.
However, this sequence in imx_pcie_host_exit() asserts the core reset
after the PHY has already been powered off and exited. Should
imx_pcie_assert_core_reset() be called before phy_power_off() to maintain
proper LIFO teardown symmetry?
> imx_pcie_clk_disable(imx_pcie);
>
> if (!pci->pp.skip_pwrctrl_off)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260722030935.2328278-1-hongxing.zhu@oss.nxp.com?part=1
prev parent reply other threads:[~2026-07-22 3:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 3:09 [PATCH v3] PCI: imx6: Fix i.MX6Q/DL boot hang caused by improper PHY power sequencing hongxing.zhu
2026-07-22 3:20 ` sashiko-bot [this message]
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=20260722032019.E70091F000E9@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