net: phy: micrel: ksz9031: reconfigure autoneg after phy autoneg workaround
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 21 Dec 2017 00:45:10 +0000 (18:45 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jan 2018 19:35:13 +0000 (20:35 +0100)
commita746fadd5e3187b814a66769355adcc9524839e6
treefa970f083061f55e86f737b6082b24f05528812a
parent03c93293a83a603fc5b87fc15321f392d3cf0043
net: phy: micrel: ksz9031: reconfigure autoneg after phy autoneg workaround

[ Upstream commit c1a8d0a3accf64a014d605e6806ce05d1c17adf1 ]

Under some circumstances driver will perform PHY reset in
ksz9031_read_status() to fix autoneg failure case (idle error count =
0xFF). When this happens ksz9031 will not detect link status change any
more when connecting to Netgear 1G switch (link can be recovered sometimes by
restarting netdevice "ifconfig down up"). Reproduced with TI am572x board
equipped with ksz9031 PHY while connecting to Netgear 1G switch.

Fix the issue by reconfiguring autonegotiation after PHY reset in
ksz9031_read_status().

Fixes: d2fd719bcb0e ("net/phy: micrel: Add workaround for bad autoneg")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/micrel.c