Skip to contentSkip to conversation

netpoll carrier clarification

PATCH In review Matt Mackall 2 participants 2 messages Mar 10, 2005 – Mar 23, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netpoll carrier clarification

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

net/core/netpoll.c +9 -4
Index: np/net/core/netpoll.c
===================================================================
@@ -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);
 		}
 	}
 
Signature · 1 line
Mathematics is the supreme nostalgia of our time.