Devicetree
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: sashiko-reviews@lists.linux.dev
Cc: Rudi Heitbaum <rudi@heitbaum.com>,
	conor+dt@kernel.org, devicetree@vger.kernel.org,
	Frank.Li@kernel.org, robh@kernel.org, linux-pci@vger.kernel.org,
	imx@lists.linux.dev
Subject: Re: [PATCH 2/3] PCI: imx6: Use the external clock as REF_CLK when needed for i.MX8MQ
Date: Thu, 6 Aug 2026 16:53:31 -0400	[thread overview]
Message-ID: <anT0S51eVwBKPdnM@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260802114928.4CEEB1F000E9@smtp.kernel.org>

On Sun, Aug 02, 2026 at 11:49:27AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] The patch breaks backward compatibility with existing i.MX8MQ device trees by changing the default reference clock source, causing PCIe initialization to fail.
> --
>
> --- Patch [2]: [PATCH 2/3] PCI: imx6: Use the external clock as REF_CLK when needed for i.MX8MQ ---
> commit 6f37370c304d3692e11e97087dc50e68e2389b9e
> Author: Rudi Heitbaum <rudi@heitbaum.com>
>
> PCI: imx6: Use the external clock as REF_CLK when needed for i.MX8MQ
>
> This commit updates the i.MX8MQ PCIe PHY initialization to conditionally
> select the external oscillator as the reference clock based on the
> enable_ext_refclk flag. It falls back to the internal PLL if an "extref"
> clock is not supplied.
>
> > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> > index 98e1db751132a..9e3b64fecb451 100644
> > --- a/drivers/pci/controller/dwc/pci-imx6.c
> > +++ b/drivers/pci/controller/dwc/pci-imx6.c
> > @@ -445,11 +445,16 @@ static int pcie_phy_write(struct imx_pcie *imx_pcie, int addr, u16 data)
> >
> >  static int imx8mq_pcie_init_phy(struct imx_pcie *imx_pcie)
> >  {
> > -	/* TODO: This code assumes external oscillator is being used */
> > +	bool ext = imx_pcie->enable_ext_refclk;
> > +
> > +	/*
> > +	 * Select the off-chip oscillator as REF_CLK when an "extref" clock is
> > +	 * supplied, otherwise fall back to the internal PLL.
> > +	 */
> >  	regmap_update_bits(imx_pcie->iomuxc_gpr,
> >  			   imx_pcie_grp_offset(imx_pcie),
> >  			   IMX8MQ_GPR_PCIE_REF_USE_PAD,
> > -			   IMX8MQ_GPR_PCIE_REF_USE_PAD);
> > +			   ext ? IMX8MQ_GPR_PCIE_REF_USE_PAD : 0);
>
> [Severity: High]
> Will this change break backward compatibility with existing i.MX8MQ device
> trees?

This is problem.  enable_ext_refclk is good direction to align imx95. but
need find way to avoid break backward compatibility.

Frank
>
> Looking at imx8mq_pcie_init_phy() in drivers/pci/controller/dwc/pci-imx6.c,
> if a legacy device tree does not provide a clock named "extref",
> imx_pcie->enable_ext_refclk evaluates to false.
>
> This causes the driver to clear IMX8MQ_GPR_PCIE_REF_USE_PAD and fall back to
> the internal PLL. On boards that previously relied on the unconditional
> external oscillator selection, this regression will cause PCIe initialization
> to fail.
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/cover.1785669457.git.rudi@heitbaum.com?part=2

  reply	other threads:[~2026-08-06 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02 11:30 [PATCH 0/3] PCI: imx6: select the PCIe REF_CLK source on i.MX8MQ Rudi Heitbaum
2026-08-02 11:31 ` [PATCH 1/3] dt-bindings: pci: fsl,imx6q-pcie: Add extref clock for i.MX8MQ Rudi Heitbaum
2026-08-02 11:40   ` sashiko-bot
2026-08-02 11:32 ` [PATCH 2/3] PCI: imx6: Use the external clock as REF_CLK when needed " Rudi Heitbaum
2026-08-02 11:49   ` sashiko-bot
2026-08-06 20:53     ` Frank Li [this message]
2026-08-07 14:02       ` Rudi Heitbaum
2026-08-02 11:32 ` [PATCH 3/3] arm64: dts: imx8mq: Declare the PCIe extref clock Rudi Heitbaum
2026-08-02 11:49   ` sashiko-bot

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=anT0S51eVwBKPdnM@lizhi-Precision-Tower-5810 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rudi@heitbaum.com \
    --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