Skip to content

Commit cbcf872

Browse files
Richard ZhuLorenzo Pieralisi
authored andcommitted
phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on()
Refer to phy_core driver, phy_init() must be called before phy_power_on(). Fix the wrong order of phy_init() and phy_power_on() here. Link: https://lore.kernel.org/r/1662344583-18874-1-git-send-email-hongxing.zhu@nxp.com Fixes: 1aa97b0 ("phy: freescale: pcie: Initialize the imx8 pcie standalone phy driver") Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Acked-by: Vinod Koul <vkoul@kernel.org> Acked-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
1 parent 3db1e53 commit cbcf872

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

drivers/pci/controller/dwc/pci-imx6.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp)
945945
}
946946

947947
if (imx6_pcie->phy) {
948-
ret = phy_power_on(imx6_pcie->phy);
948+
ret = phy_init(imx6_pcie->phy);
949949
if (ret) {
950950
dev_err(dev, "pcie PHY power up failed\n");
951951
goto err_clk_disable;
@@ -959,7 +959,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp)
959959
}
960960

961961
if (imx6_pcie->phy) {
962-
ret = phy_init(imx6_pcie->phy);
962+
ret = phy_power_on(imx6_pcie->phy);
963963
if (ret) {
964964
dev_err(dev, "waiting for PHY ready timeout!\n");
965965
goto err_phy_off;
@@ -971,7 +971,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp)
971971

972972
err_phy_off:
973973
if (imx6_pcie->phy)
974-
phy_power_off(imx6_pcie->phy);
974+
phy_exit(imx6_pcie->phy);
975975
err_clk_disable:
976976
imx6_pcie_clk_disable(imx6_pcie);
977977
err_reg_disable:

drivers/phy/freescale/phy-fsl-imx8m-pcie.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct imx8_pcie_phy {
5959
bool clkreq_unused;
6060
};
6161

62-
static int imx8_pcie_phy_init(struct phy *phy)
62+
static int imx8_pcie_phy_power_on(struct phy *phy)
6363
{
6464
int ret;
6565
u32 val, pad_mode;
@@ -137,14 +137,14 @@ static int imx8_pcie_phy_init(struct phy *phy)
137137
return ret;
138138
}
139139

140-
static int imx8_pcie_phy_power_on(struct phy *phy)
140+
static int imx8_pcie_phy_init(struct phy *phy)
141141
{
142142
struct imx8_pcie_phy *imx8_phy = phy_get_drvdata(phy);
143143

144144
return clk_prepare_enable(imx8_phy->clk);
145145
}
146146

147-
static int imx8_pcie_phy_power_off(struct phy *phy)
147+
static int imx8_pcie_phy_exit(struct phy *phy)
148148
{
149149
struct imx8_pcie_phy *imx8_phy = phy_get_drvdata(phy);
150150

@@ -155,8 +155,8 @@ static int imx8_pcie_phy_power_off(struct phy *phy)
155155

156156
static const struct phy_ops imx8_pcie_phy_ops = {
157157
.init = imx8_pcie_phy_init,
158+
.exit = imx8_pcie_phy_exit,
158159
.power_on = imx8_pcie_phy_power_on,
159-
.power_off = imx8_pcie_phy_power_off,
160160
.owner = THIS_MODULE,
161161
};
162162

0 commit comments

Comments
 (0)