Commit bff38771e1065c7fc3de87e47ba366151eea573c

Authored by Anton Vorontsov
Committed by David S. Miller
1 parent 34701fde8f

netpoll: Introduce netpoll_carrier_timeout kernel option

Some PHYs require longer timeouts for carrier detection, and
auto-negotiation process may take indefinite amount of time.

It may be inconvenient to force longer timeouts for sane PHYs,
so let's introduce a kernel command line option.

Since we're using module_param(), the option also can be
changed in runtime.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 2 changed files with 10 additions and 1 deletions Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -1531,6 +1531,11 @@
1531 1531 symbolic names: lapic and ioapic
1532 1532 Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic
1533 1533  
  1534 + netpoll.carrier_timeout=
  1535 + [NET] Specifies amount of time (in seconds) that
  1536 + netpoll should wait for a carrier. By default netpoll
  1537 + waits 4 seconds.
  1538 +
1534 1539 no387 [BUGS=X86-32] Tells the kernel to use the 387 maths
1535 1540 emulation library even if a 387 maths coprocessor
1536 1541 is present.
... ... @@ -9,6 +9,7 @@
9 9 * Copyright (C) 2002 Red Hat, Inc.
10 10 */
11 11  
  12 +#include <linux/moduleparam.h>
12 13 #include <linux/netdevice.h>
13 14 #include <linux/etherdevice.h>
14 15 #include <linux/string.h>
... ... @@ -50,6 +51,9 @@
50 51 static void zap_completion_queue(void);
51 52 static void arp_reply(struct sk_buff *skb);
52 53  
  54 +static unsigned int carrier_timeout = 4;
  55 +module_param(carrier_timeout, uint, 0644);
  56 +
53 57 static void queue_process(struct work_struct *work)
54 58 {
55 59 struct netpoll_info *npinfo =
... ... @@ -732,7 +736,7 @@
732 736 }
733 737  
734 738 atleast = jiffies + HZ/10;
735   - atmost = jiffies + 4*HZ;
  739 + atmost = jiffies + carrier_timeout * HZ;
736 740 while (!netif_carrier_ok(ndev)) {
737 741 if (time_after(jiffies, atmost)) {
738 742 printk(KERN_NOTICE