netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: netdev@vger.kernel.org
Cc: rt2x00-devel@lfcorreia.dyndns.org
Subject: [PATCH 19/32] rt2x00: Fix panics in interrupt handlers
Date: Fri, 28 Apr 2006 00:03:11 +0200	[thread overview]
Message-ID: <200604280003.11902.IvDoorn@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3624 bytes --]

From: Ivo van Doorn <IvDoorn@gmail.com>

Fix panics when the interrupt handlers are being
run while the ring is empty.
During the interrupt handling break the loop
correctly when an error has been detected,
more work is being done after the loop.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-27 21:49:59.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-27 21:50:36.000000000 +0200
@@ -844,7 +844,7 @@ rt2400pci_rxdone(void *data)
 		&& !rt2x00_get_field32(rxd->word0, RXD_W0_PHYSICAL_ERROR)) {
 			skb = dev_alloc_skb(size + NET_IP_ALIGN);
 			if (!skb)
-				return;
+				break;
 
 			skb_reserve(skb, NET_IP_ALIGN);
 
@@ -859,7 +859,7 @@ rt2400pci_rxdone(void *data)
 
 		rt2x00_set_field32(&rxd->word0, RXD_W0_OWNER_NIC, 1);
 
-		rt2x00_ring_index_inc(&rt2x00pci->rx);
+		rt2x00_ring_index_inc(ring);
 	}
 
 	/*
@@ -879,7 +879,7 @@ rt2400pci_txdone(void *data)
 	int			tx_status;
 	int			ack;
 
-	do {
+	 while (!rt2x00_ring_empty(ring)) {
 		entry = rt2x00_get_data_entry_done(ring);
 		txd = entry->desc_addr;
 
@@ -925,7 +925,7 @@ rt2400pci_txdone(void *data)
 		entry->skb = NULL;
 
 		rt2x00_ring_index_done_inc(ring);
-	} while (!rt2x00_ring_empty(ring));
+	}
 
 	/*
 	 * Check if we are waiting on an empty queue
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-27 21:49:59.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-27 21:50:36.000000000 +0200
@@ -926,7 +926,7 @@ rt2500pci_rxdone(void *data)
 		&& !rt2x00_get_field32(rxd->word0, RXD_W0_PHYSICAL_ERROR)) {
 			skb = dev_alloc_skb(size + NET_IP_ALIGN);
 			if (!skb)
-				return;
+				break;
 
 			skb_reserve(skb, NET_IP_ALIGN);
 
@@ -943,7 +943,7 @@ rt2500pci_rxdone(void *data)
 		}
 		rt2x00_set_field32(&rxd->word0, RXD_W0_OWNER_NIC, 1);
 
-		rt2x00_ring_index_inc(&rt2x00pci->rx);
+		rt2x00_ring_index_inc(ring);
 	}
 
 	/*
@@ -964,7 +964,7 @@ rt2500pci_txdone(void *data)
 	int			tx_status;
 	int			ack;
 
-	do {
+	 while (!rt2x00_ring_empty(ring)) {
 		entry = rt2x00_get_data_entry_done(ring);
 		txd = entry->desc_addr;
 
@@ -1010,7 +1010,7 @@ rt2500pci_txdone(void *data)
 		entry->skb = NULL;
 
 		rt2x00_ring_index_done_inc(ring);
-	} while (!rt2x00_ring_empty(ring));
+	}
 
 	/*
 	 * Check if we are waiting on an empty queue
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-27 21:49:59.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-27 21:50:36.000000000 +0200
@@ -808,7 +808,7 @@ rt2500usb_txdone(void *data)
 	struct txd		*txd;
 	int			ack;
 
-	do {
+	 while (!rt2x00_ring_empty(ring)) {
 		entry = rt2x00_get_data_entry_done(ring);
 		txd = entry->desc_addr;
 
@@ -843,7 +843,7 @@ rt2500usb_txdone(void *data)
 		entry->skb = NULL;
 	
 		rt2x00_ring_index_done_inc(entry->ring);
-	} while (!rt2x00_ring_empty(ring));
+	}
 
 	/*
 	 * Check if we are waiting on an empty queue

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

                 reply	other threads:[~2006-04-27 22:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200604280003.11902.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rt2x00-devel@lfcorreia.dyndns.org \
    /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).