[PATCH 4/4] net phylib: Call phy_update_status when no link is present

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

 



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@xxxxxxxxxxxxxx>
---
 net/eth.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/eth.c b/net/eth.c
index 0a1850f..101fc10 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -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;
-- 
1.7.10.4


_______________________________________________
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