* [PATCH][RESEND] net: fec: Fix PHY init after phy_reset_after_clk_enable()
@ 2020-10-06 13:52 Marek Vasut
2020-10-09 0:51 ` Jakub Kicinski
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2020-10-06 13:52 UTC (permalink / raw)
To: netdev
Cc: Marek Vasut, Andrew Lunn, Richard Leitner, Christoph Niedermaier,
David S . Miller, NXP Linux Team, Shawn Guo
The phy_reset_after_clk_enable() does a PHY reset, which means the PHY
loses its register settings. The fec_enet_mii_probe() starts the PHY
and does the necessary calls to configure the PHY via PHY framework,
and loads the correct register settings into the PHY. Therefore,
fec_enet_mii_probe() should be called only after the PHY has been
reset, not before as it is now.
Fixes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Richard Leitner <richard.leitner@skidata.com>
Cc: Shawn Guo <shawnguo@kernel.org>
---
drivers/net/ethernet/freescale/fec_main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index c043afb38b6e..2d5433301843 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2983,17 +2983,17 @@ fec_enet_open(struct net_device *ndev)
/* Init MAC prior to mii bus probe */
fec_restart(ndev);
- /* Probe and connect to PHY when open the interface */
- ret = fec_enet_mii_probe(ndev);
- if (ret)
- goto err_enet_mii_probe;
-
/* Call phy_reset_after_clk_enable() again if it failed during
* phy_reset_after_clk_enable() before because the PHY wasn't probed.
*/
if (reset_again)
phy_reset_after_clk_enable(ndev->phydev);
+ /* Probe and connect to PHY when open the interface */
+ ret = fec_enet_mii_probe(ndev);
+ if (ret)
+ goto err_enet_mii_probe;
+
if (fep->quirks & FEC_QUIRK_ERR006687)
imx6q_cpuidle_fec_irqs_used();
--
2.28.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][RESEND] net: fec: Fix PHY init after phy_reset_after_clk_enable()
2020-10-06 13:52 [PATCH][RESEND] net: fec: Fix PHY init after phy_reset_after_clk_enable() Marek Vasut
@ 2020-10-09 0:51 ` Jakub Kicinski
2020-10-09 7:21 ` Marek Vasut
0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2020-10-09 0:51 UTC (permalink / raw)
To: Marek Vasut
Cc: netdev, Andrew Lunn, Richard Leitner, Christoph Niedermaier,
David S . Miller, NXP Linux Team, Shawn Guo
On Tue, 6 Oct 2020 15:52:53 +0200 Marek Vasut wrote:
> The phy_reset_after_clk_enable() does a PHY reset, which means the PHY
> loses its register settings. The fec_enet_mii_probe() starts the PHY
> and does the necessary calls to configure the PHY via PHY framework,
> and loads the correct register settings into the PHY. Therefore,
> fec_enet_mii_probe() should be called only after the PHY has been
> reset, not before as it is now.
>
> Fixes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support")
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Tested-by: Richard Leitner <richard.leitner@skidata.com>
> Signed-off-by: Marek Vasut <marex@denx.de>
Is moving the reset before fec_enet_mii_probe() the reason you need the
second patch?
net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][RESEND] net: fec: Fix PHY init after phy_reset_after_clk_enable()
2020-10-09 0:51 ` Jakub Kicinski
@ 2020-10-09 7:21 ` Marek Vasut
2020-10-09 15:24 ` Jakub Kicinski
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2020-10-09 7:21 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev, Andrew Lunn, Richard Leitner, Christoph Niedermaier,
David S . Miller, NXP Linux Team, Shawn Guo
On 10/9/20 2:51 AM, Jakub Kicinski wrote:
> On Tue, 6 Oct 2020 15:52:53 +0200 Marek Vasut wrote:
>> The phy_reset_after_clk_enable() does a PHY reset, which means the PHY
>> loses its register settings. The fec_enet_mii_probe() starts the PHY
>> and does the necessary calls to configure the PHY via PHY framework,
>> and loads the correct register settings into the PHY. Therefore,
>> fec_enet_mii_probe() should be called only after the PHY has been
>> reset, not before as it is now.
>>
>> Fixes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support")
>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>> Tested-by: Richard Leitner <richard.leitner@skidata.com>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>
> Is moving the reset before fec_enet_mii_probe() the reason you need the
> second patch?
>
> net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()
No, the second patch addresses separate issue.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][RESEND] net: fec: Fix PHY init after phy_reset_after_clk_enable()
2020-10-09 7:21 ` Marek Vasut
@ 2020-10-09 15:24 ` Jakub Kicinski
0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2020-10-09 15:24 UTC (permalink / raw)
To: Marek Vasut
Cc: netdev, Andrew Lunn, Richard Leitner, Christoph Niedermaier,
David S . Miller, NXP Linux Team, Shawn Guo
On Fri, 9 Oct 2020 09:21:06 +0200 Marek Vasut wrote:
> On 10/9/20 2:51 AM, Jakub Kicinski wrote:
> > On Tue, 6 Oct 2020 15:52:53 +0200 Marek Vasut wrote:
> >> The phy_reset_after_clk_enable() does a PHY reset, which means the PHY
> >> loses its register settings. The fec_enet_mii_probe() starts the PHY
> >> and does the necessary calls to configure the PHY via PHY framework,
> >> and loads the correct register settings into the PHY. Therefore,
> >> fec_enet_mii_probe() should be called only after the PHY has been
> >> reset, not before as it is now.
> >>
> >> Fixes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support")
> >> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> >> Tested-by: Richard Leitner <richard.leitner@skidata.com>
> >> Signed-off-by: Marek Vasut <marex@denx.de>
> >
> > Is moving the reset before fec_enet_mii_probe() the reason you need the
> > second patch?
> >
> > net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()
>
> No, the second patch addresses separate issue.
I see. Applied to net and queued for stable, thank you!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-09 15:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 13:52 [PATCH][RESEND] net: fec: Fix PHY init after phy_reset_after_clk_enable() Marek Vasut
2020-10-09 0:51 ` Jakub Kicinski
2020-10-09 7:21 ` Marek Vasut
2020-10-09 15:24 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).