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>
This commit is contained in:
parent
ac48b10467
commit
025d80a05d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue