[PATCH] net: phy: micrel: fix too late link up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christian Hemp <c.hemp@xxxxxxxxx>

Since commit a4cee7207a1 ("net: phy: micrel: Add workaround for bad
autoneg") by Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>:

    Based on kernel commit d2fd719bcb0e ("net/phy: micrel: Add workaround
    for bad autoneg") by Nathan Sullivan <nathan.sullivan@xxxxxx>:

        Very rarely, the KSZ9031 will appear to complete autonegotiation, but
        will drop all traffic afterwards.  When this happens, the idle error
        count will read 0xFF after autonegotiation completes. Reset the PHY
        when in that state.

is it possible that we get the link to late and  barebox reports "Network is
down". The problem is that ksz9031_config_init is called again in an
error case. In this case autoneg will restart but waiting for finish is
missing.

Signed-off-by: Christian Hemp <c.hemp@xxxxxxxxx>
Tested-by: Stefan Müller-Klieser <s.mueller-klieser@xxxxxxxxx>
---
 drivers/net/phy/micrel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 0ca359b0ba..fe71bfd1a6 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -293,6 +293,7 @@ static int ksz9031_read_status(struct phy_device *phydev)
 	if ((regval & 0xff) == 0xff) {
 		phy_init_hw(phydev);
 		phydev->link = 0;
+		phy_wait_aneg_done(phydev);
 	}
 
 	return 0;
-- 
2.16.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux