summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-12-11 12:14:43 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-12-12 20:02:44 +0100
commita1a50a465485dea02aa58ed861ae4594922e7c54 (patch)
tree745a0b95440f20cbcaf11802222928d0d69f6305 /net
parent11cb1620fec786ced1be458a21c4c53ee6870d1d (diff)
downloadbarebox-a1a50a465485dea02aa58ed861ae4594922e7c54.tar.gz
barebox-a1a50a465485dea02aa58ed861ae4594922e7c54.tar.xz
net phylib: force to wait for link
When starting a network device wait until the link is up. Otherwise autobooting does not work with little timeout and several attempts have to be made until the network is finally up. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r--net/eth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/eth.c b/net/eth.c
index 101fc10171..abb2eafac4 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -138,6 +138,9 @@ static int eth_carrier_check(int force)
if (!eth_current->phydev)
return 0;
+ if (force)
+ phy_wait_aneg_done(eth_current->phydev);
+
if (force || is_timeout(last_link_check, 5 * SECOND) ||
!eth_current->phydev->link) {
ret = phy_update_status(eth_current->phydev);