ipq40xx: net: ethernet: edma: fix link detection
authorRobert Marko <robert.marko@sartura.hr>
Thu, 8 Oct 2020 10:19:05 +0000 (12:19 +0200)
committerPetr Štetiar <ynezz@true.cz>
Wed, 23 Dec 2020 15:36:08 +0000 (16:36 +0100)
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>
target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c

index 5f2630ae508d16375b2836d9a53b8680e8078620..ecbc946de9334b816b250dbbd733748db4e35137 100644 (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;