* [PATCH v1] PCI: imx6: Fix reference clock source selection
@ 2026-03-25 9:31 Franz Schnyder
2026-03-26 1:20 ` Hongxing Zhu
0 siblings, 1 reply; 2+ messages in thread
From: Franz Schnyder @ 2026-03-25 9:31 UTC (permalink / raw)
To: Richard Zhu, Lucas Stach, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Bjorn Helgaas, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam
Cc: Franz Schnyder, linux-pci, linux-arm-kernel, imx, linux-kernel,
Francesco Dolcini, stable
From: Franz Schnyder <franz.schnyder@toradex.com>
In the PCIe PHY init for the iMX95, the reference clock source selection
uses a conditional instead of always passing the mask. This currently
breaks functionality if the internal refclk is used.
Pass always IMX95_PCIE_REF_USE_PAD as the mask and clear the bit if
external refclk is not used.
Fixes: d8574ce57d76 ("PCI: imx6: Add external reference clock input mode support")
Cc: stable@vger.kernel.org
Signed-off-by: Franz Schnyder <franz.schnyder@toradex.com>
---
drivers/pci/controller/dwc/pci-imx6.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 81a7093494c8..e0580d6efa57 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -268,8 +268,8 @@ static int imx95_pcie_init_phy(struct imx_pcie *imx_pcie)
IMX95_PCIE_PHY_CR_PARA_SEL);
regmap_update_bits(imx_pcie->iomuxc_gpr, IMX95_PCIE_PHY_GEN_CTRL,
- ext ? IMX95_PCIE_REF_USE_PAD : 0,
- IMX95_PCIE_REF_USE_PAD);
+ IMX95_PCIE_REF_USE_PAD,
+ ext ? IMX95_PCIE_REF_USE_PAD : 0);
regmap_update_bits(imx_pcie->iomuxc_gpr, IMX95_PCIE_SS_RW_REG_0,
IMX95_PCIE_REF_CLKEN,
ext ? 0 : IMX95_PCIE_REF_CLKEN);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH v1] PCI: imx6: Fix reference clock source selection
2026-03-25 9:31 [PATCH v1] PCI: imx6: Fix reference clock source selection Franz Schnyder
@ 2026-03-26 1:20 ` Hongxing Zhu
0 siblings, 0 replies; 2+ messages in thread
From: Hongxing Zhu @ 2026-03-26 1:20 UTC (permalink / raw)
To: Franz Schnyder, Lucas Stach, Lorenzo Pieralisi,
Krzysztof Wilczy��ski, Manivannan Sadhasivam,
Rob Herring, Bjorn Helgaas, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Franz Schnyder, linux-pci@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
linux-kernel@vger.kernel.org, Francesco Dolcini,
stable@vger.kernel.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 2564 bytes --]
> -----Original Message-----
> From: Franz Schnyder <fra.schnyder@gmail.com>
> Sent: 2026Äê3ÔÂ25ÈÕ 17:31
> To: Hongxing Zhu <hongxing.zhu@nxp.com>; Lucas Stach
> <l.stach@pengutronix.de>; Lorenzo Pieralisi <lpieralisi@kernel.org>;
> Krzysztof Wilczy¨½ski <kwilczynski@kernel.org>; Manivannan Sadhasivam
> <mani@kernel.org>; Rob Herring <robh@kernel.org>; Bjorn Helgaas
> <bhelgaas@google.com>; Frank Li <frank.li@nxp.com>; Sascha Hauer
> <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>
> Cc: Franz Schnyder <franz.schnyder@toradex.com>;
> linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> imx@lists.linux.dev; linux-kernel@vger.kernel.org; Francesco Dolcini
> <francesco.dolcini@toradex.com>; stable@vger.kernel.org
> Subject: [PATCH v1] PCI: imx6: Fix reference clock source selection
>
> From: Franz Schnyder <franz.schnyder@toradex.com>
>
> In the PCIe PHY init for the iMX95, the reference clock source selection uses
> a conditional instead of always passing the mask. This currently breaks
> functionality if the internal refclk is used.
>
> Pass always IMX95_PCIE_REF_USE_PAD as the mask and clear the bit if
> external refclk is not used.
>
> Fixes: d8574ce57d76 ("PCI: imx6: Add external reference clock input mode
> support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Franz Schnyder <franz.schnyder@toradex.com>
Apologies, I made an error when organizing the code.
This bug was not caught during local testing because the external OSC clock
input is permanently enabled on the EVK board.
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>
Best Regards
Richard Zhu
> ---
> drivers/pci/controller/dwc/pci-imx6.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c
> b/drivers/pci/controller/dwc/pci-imx6.c
> index 81a7093494c8..e0580d6efa57 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -268,8 +268,8 @@ static int imx95_pcie_init_phy(struct imx_pcie
> *imx_pcie)
> IMX95_PCIE_PHY_CR_PARA_SEL);
>
> regmap_update_bits(imx_pcie->iomuxc_gpr,
> IMX95_PCIE_PHY_GEN_CTRL,
> - ext ? IMX95_PCIE_REF_USE_PAD : 0,
> - IMX95_PCIE_REF_USE_PAD);
> + IMX95_PCIE_REF_USE_PAD,
> + ext ? IMX95_PCIE_REF_USE_PAD : 0);
> regmap_update_bits(imx_pcie->iomuxc_gpr, IMX95_PCIE_SS_RW_REG_0,
> IMX95_PCIE_REF_CLKEN,
> ext ? 0 : IMX95_PCIE_REF_CLKEN);
> --
> 2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-26 1:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 9:31 [PATCH v1] PCI: imx6: Fix reference clock source selection Franz Schnyder
2026-03-26 1:20 ` Hongxing Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox