ipq40xx: net: ethernet: edma: fix link detection

PHY needs to be soft reset before starting it from ethernet driver as
AR40xx calibration will leave it in unwanted state.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
This commit is contained in:
Robert Marko 2020-10-08 12:19:05 +02:00 committed by Petr Štetiar
parent 26b1f72381
commit 053c3d8e0b

View File

@ -2023,6 +2023,10 @@ int edma_open(struct net_device *netdev)
*/
if (adapter->poll_required) {
if (!IS_ERR(adapter->phydev)) {
/* AR40xx calibration will leave the PHY in unwanted state,
* so a soft reset is required before phy_start()
*/
genphy_soft_reset(adapter->phydev);
phy_start(adapter->phydev);
phy_start_aneg(adapter->phydev);
adapter->link_state = __EDMA_LINKDOWN;