> -----Original Message----- > From: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> > Sent: 2022年10月12日 21:27 > To: linux-pci@xxxxxxxxxxxxxxx > Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; Hongxing Zhu > <hongxing.zhu@xxxxxxx>; Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>; > Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>; dl-linux-imx > <linux-imx@xxxxxxx>; Rob Herring <robh@xxxxxxxxxx>; Krzysztof Wilczy?ski > <kw@xxxxxxxxx>; Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> > Subject: [PATCH] PCI: imx6: Fix link initialisation when the phy is ref clk > provider > > When the phy is the reference clock provider then it must be initialised and > powered on before the reset on the client is deasserted, otherwise the link will > never come up. The order was changed in cf236e0c0d59. > Restore the correct order to make the driver work again on boards where the > phy provides the reference clock. > > Fixes: cf236e0c0d59 ("PCI: imx6: Do not hide PHY driver callbacks and refine > the error handling") > Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> Hi Sascha: Thanks for your patch. initialisation /s/ initialization Initialised /s/ initialized As I remember that the sequence of the initialization is not changed in cf236e0c0d59 ("PCI: imx6: Do not hide PHY driver callbacks and refine the error handling") That commit just refactors the codes, and doesn't change the init-sequence. Anyway, I had tested your patch on i.MX8MM and i.MX8MP EVK boards. Both of these two boards works fine when the NVME device is inserted. Tested-by: Richard Zhu <hongxing.zhu@xxxxxxx> Best Regards Richard Zhu > --- > drivers/pci/controller/dwc/pci-imx6.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-imx6.c > b/drivers/pci/controller/dwc/pci-imx6.c > index b5f0de455a7bd..211eb55d6d34b 100644 > --- a/drivers/pci/controller/dwc/pci-imx6.c > +++ b/drivers/pci/controller/dwc/pci-imx6.c > @@ -942,12 +942,6 @@ static int imx6_pcie_host_init(struct dw_pcie_rp > *pp) > } > } > > - ret = imx6_pcie_deassert_core_reset(imx6_pcie); > - if (ret < 0) { > - dev_err(dev, "pcie deassert core reset failed: %d\n", ret); > - goto err_phy_off; > - } > - > if (imx6_pcie->phy) { > ret = phy_power_on(imx6_pcie->phy); > if (ret) { > @@ -955,6 +949,13 @@ static int imx6_pcie_host_init(struct dw_pcie_rp > *pp) > goto err_phy_off; > } > } > + > + ret = imx6_pcie_deassert_core_reset(imx6_pcie); > + if (ret < 0) { > + dev_err(dev, "pcie deassert core reset failed: %d\n", ret); > + goto err_phy_off; > + } > + > imx6_setup_phy_mpll(imx6_pcie); > > return 0; > -- > 2.30.2