aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-07-08 23:09:44 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-08 23:09:44 -0400
commit1b614fb9a00e97b1eab54d4e442d405229c059dd (patch)
tree3260cee5b11a106e7f4e630171627c6e3e528a0f
parentd2daeabf62a5fb205d413c35cf604021db17536b (diff)
netpoll: Fix carrier detection for drivers that are using phylib
Using early netconsole and gianfar driver this error pops up: netconsole: timeout waiting for carrier It appears that net/core/netpoll.c:netpoll_setup() is using cond_resched() in a loop waiting for a carrier. The thing is that cond_resched() is a no-op when system_state != SYSTEM_RUNNING, and so drivers/net/phy/phy.c's state_queue is never scheduled, therefore link detection doesn't work. I belive that the main problem is in cond_resched()[1], but despite how the cond_resched() story ends, it might be a good idea to call msleep(1) instead of cond_resched(), as suggested by Andrew Morton. [1] http://lkml.org/lkml/2009/7/7/463 Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/netpoll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 9675f312830d..df30feb2fc72 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -740,7 +740,7 @@ int netpoll_setup(struct netpoll *np)
740 np->name); 740 np->name);
741 break; 741 break;
742 } 742 }
743 cond_resched(); 743 msleep(1);
744 } 744 }
745 745
746 /* If carrier appears to come up instantly, we don't 746 /* If carrier appears to come up instantly, we don't