diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-08 17:54:03 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-08 17:54:06 +0100 |
commit | 025d80a05d9381e341b165d7847569a0ef65a509 (patch) | |
tree | 89dae742bf47fa69861d99c7b240970bed835532 /net | |
parent | ac48b10467ffb1c45e67e5efe36413ede140a498 (diff) | |
download | barebox-025d80a05d9381e341b165d7847569a0ef65a509.tar.gz barebox-025d80a05d9381e341b165d7847569a0ef65a509.tar.xz |
net phylib: Call phy_update_status when no link is present
We call phy_update_status only once in 5 seconds. This makes
sure we do not have great overhead when using ethernet devices.
However, if phylib tells us the link is down anyway, there won't
be ethernet transfers, so it doesn't hurt to call phy_update_status
in this case. This makes sure we can use the ethernet device when
the link comes up and do not have an additional 5 second penalty
in this case.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/eth.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -138,7 +138,8 @@ static int eth_carrier_check(int force) if (!eth_current->phydev) return 0; - if (force || is_timeout(last_link_check, 5 * SECOND)) { + if (force || is_timeout(last_link_check, 5 * SECOND) || + !eth_current->phydev->link) { ret = phy_update_status(eth_current->phydev); if (ret) return ret; |