[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201027135455.337503286@linuxfoundation.org>
Date: Tue, 27 Oct 2020 14:49:04 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
Richard Leitner <richard.leitner@...data.com>,
Marek Vasut <marex@...x.de>,
Christoph Niedermaier <cniedermaier@...electronics.com>,
"David S. Miller" <davem@...emloft.net>,
NXP Linux Team <linux-imx@....com>,
Shawn Guo <shawnguo@...nel.org>,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH 5.4 006/408] net: fec: Fix PHY init after phy_reset_after_clk_enable()
From: Marek Vasut <marex@...x.de>
[ Upstream commit 0da1ccbbefb662915228bc17e1c7d4ad28b3ddab ]
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@...n.ch>
Tested-by: Richard Leitner <richard.leitner@...data.com>
Signed-off-by: Marek Vasut <marex@...x.de>
Cc: Christoph Niedermaier <cniedermaier@...electronics.com>
Cc: David S. Miller <davem@...emloft.net>
Cc: NXP Linux Team <linux-imx@....com>
Cc: Shawn Guo <shawnguo@...nel.org>
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/net/ethernet/freescale/fec_main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3003,17 +3003,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)
fec_enet_phy_reset_after_clk_enable(ndev);
+ /* 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();
Powered by blists - more mailing lists