Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bffdde0 authored by Marek Vasut's avatar Marek Vasut Committed by Greg Kroah-Hartman
Browse files

net: fec: Fix PHY init after phy_reset_after_clk_enable()



[ 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: 1b0a83ac ("net: fec: add phy_reset_after_clk_enable() support")
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Tested-by: default avatarRichard Leitner <richard.leitner@skidata.com>
Signed-off-by: default avatarMarek 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: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c068e505
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2950,17 +2950,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();