RE: [PATCH v6 08/11] PCI: dwc: Invoke post_init in dw_pcie_resume_noirq()
From: Hongxing Zhu <hongxing.zhu@nxp.com>
Date: 2026-01-09 02:10:09
Also in:
imx, linux-devicetree, linux-pci, lkml
-----Original Message----- From: Bjorn Helgaas <helgaas@kernel.org> Sent: 2026年1月9日 5:50 To: Hongxing Zhu <hongxing.zhu@nxp.com> Cc: Frank Li <frank.li@nxp.com>; l.stach@pengutronix.de; lpieralisi@kernel.org; kwilczynski@kernel.org; mani@kernel.org; robh@kernel.org; krzk+dt@kernel.org; conor+dt@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; devicetree@vger.kernel.org; imx@lists.linux.dev; linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 08/11] PCI: dwc: Invoke post_init in dw_pcie_resume_noirq() On Wed, Oct 15, 2025 at 11:04:25AM +0800, Richard Zhu wrote:quoted
If the ops has post_init callback, invoke it in dw_pcie_resume_noirq().I'm trying to write the merge commit log for this branch, and I don't quite understand this. The effect is to apply the GEN3_ZRXDC_NONCOMPL workaround for the ERR051586 erratum, and Mani added the hint that this enables REFCLK during resume. But it seems weird that we apply a REFCLK workaround after the link is already up. During probe, .post_init() is run after pci_host_probe(), so we apply the workaround after enumerating all the devices, which means REFCLK must already be valid and the link is already up. Is "enabling REFCLK" actually what imx_pcie_host_post_init() does?
The codes are used to clean up the CLKREQ# override active low configurations after link is up and the CLKREQ# is drove to low by remote endpoint device at this point(support-clkreq is TRUE). It paves the way to support the CLKREQ# toggling mandatory required by L1SS.
Could the workaround be done in imx_pcie_host_init() before the link is brought up? If it could, it looks like we wouldn't need imx_pcie_host_post_init() at all.
Two actions are done in imx_pcie_post_init().
One is to apply the workaround of ERR051586 by commit 744a1c20ce93 ("PCI:
imx6: Add workaround for errata ERR051586"). It should be applied after link
is up.
The other one is to clean up the CLKREQ# override active low configurations
previous set in imx_pcie_host_init().
Hope this can resolve your confusions.
Best Regards
Richard ZhuFor now, I put this in the merge commit log: - Apply i.MX95 ERR051586 erratum workaround for REFCLK issue during resume (Richard Zhu)quoted
--- drivers/pci/controller/dwc/pcie-designware-host.c | 3 +++ 1 file changed, 3 insertions(+)diff --git a/drivers/pci/controller/dwc/pcie-designware-host.cb/drivers/pci/controller/dwc/pcie-designware-host.c index 20c9333bcb1c4..2b59e7d2e6179 100644--- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c@@ -1199,6 +1199,9 @@ int dw_pcie_resume_noirq(struct dw_pcie *pci) if (ret) return ret; + if (pci->pp.ops->post_init) + pci->pp.ops->post_init(&pci->pp); + return ret; } EXPORT_SYMBOL_GPL(dw_pcie_resume_noirq); --2.37.1