netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: netdev@oss.sgi.com, mpm@selenic.com, davem@redhat.com
Subject: [PATCH] Fix deadlock in netconsole with no carrier
Date: Tue, 19 Apr 2005 15:53:50 +0200	[thread overview]
Message-ID: <20050419135350.GH7715@wotan.suse.de> (raw)


I got a deadlock at boot with netconsole when the netword card
did not have a cable connected. This patch fixes this by limiting
the number of retries. 

Also when we run into the device spinlock dont poll all the time,
just spin.

Signed-off-by: Andi Kleen <ak@suse.de>


diff -u net/core/netpoll.c-o net/core/netpoll.c
--- net/core/netpoll.c-o	2005-03-02 08:38:32.000000000 +0100
+++ net/core/netpoll.c	2005-04-19 15:50:42.959142733 +0200
@@ -190,9 +190,10 @@
 static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
 {
 	int status;
+	int try = 5; 
 
 repeat:
-	if(!np || !np->dev || !netif_running(np->dev)) {
+	if(try-- == 0 || !np || !np->dev || !netif_running(np->dev)) {
 		__kfree_skb(skb);
 		return;
 	}
@@ -218,6 +219,10 @@
 
 	/* transmit busy */
 	if(status) {
+		if (status == NETDEV_TX_LOCKED) {
+			try++;
+			goto repeat;
+		}
 		netpoll_poll(np);
 		goto repeat;
 	}

             reply	other threads:[~2005-04-19 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19 13:53 Andi Kleen [this message]
2005-04-19 17:06 ` [PATCH] Fix deadlock in netconsole with no carrier Matt Mackall
2005-04-26 13:47   ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050419135350.GH7715@wotan.suse.de \
    --to=ak@suse.de \
    --cc=davem@redhat.com \
    --cc=mpm@selenic.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).