netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netpoll carrier clarification
@ 2005-03-10 23:21 Matt Mackall
  2005-03-23  2:39 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Mackall @ 2005-03-10 23:21 UTC (permalink / raw)
  To: Dave Miller, netdev, Patrick McHardy

Clarify the flaky carrier detect code and use msleep().

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: np/net/core/netpoll.c
===================================================================
--- np.orig/net/core/netpoll.c	2005-03-10 16:47:54.000000000 -0600
+++ np/net/core/netpoll.c	2005-03-10 17:15:34.000000000 -0600
@@ -18,6 +18,7 @@
 #include <linux/interrupt.h>
 #include <linux/netpoll.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/rcupdate.h>
 #include <linux/workqueue.h>
 #include <net/tcp.h>
@@ -660,12 +661,16 @@ int netpoll_setup(struct netpoll *np)
 			cond_resched();
 		}
 
+		/* If carrier appears to come up instantly, we don't
+		 * trust it and pause so that we don't pump all our
+		 * queued console messages into the bitbucket.
+		 */
+
 		if (time_before(jiffies, atleast)) {
-			printk(KERN_NOTICE "%s: carrier detect appears flaky,"
-			       " waiting 4 seconds\n",
+			printk(KERN_NOTICE "%s: carrier detect appears"
+			       " untrustworthy, waiting 4 seconds\n",
 			       np->name);
-			while (time_before(jiffies, atmost))
-				cond_resched();
+			msleep(4000);
 		}
 	}
 

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] netpoll carrier clarification
  2005-03-10 23:21 [PATCH] netpoll carrier clarification Matt Mackall
@ 2005-03-23  2:39 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2005-03-23  2:39 UTC (permalink / raw)
  To: Matt Mackall; +Cc: netdev, kaber

On Thu, 10 Mar 2005 15:21:38 -0800
Matt Mackall <mpm@selenic.com> wrote:

> Clarify the flaky carrier detect code and use msleep().
> 
> Signed-off-by: Matt Mackall <mpm@selenic.com>

Ok, I'll apply this.  Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-23  2:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-10 23:21 [PATCH] netpoll carrier clarification Matt Mackall
2005-03-23  2:39 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).