Skip to content

Commit

Permalink
netpoll: Fix carrier detection for drivers that are using phylib
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Anton Vorontsov authored and davem330 committed Jul 9, 2009
1 parent d2daeab commit 1b614fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ int netpoll_setup(struct netpoll *np)
np->name);
break;
}
cond_resched();
msleep(1);
}

/* If carrier appears to come up instantly, we don't
Expand Down

0 comments on commit 1b614fb

Please sign in to comment.