rt2x00: Allow rt61 to catch up after a missing tx report
authorMattias Nissler <mattias.nissler@gmx.de>
Mon, 12 Nov 2007 14:03:12 +0000 (15:03 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 10 Jan 2008 21:18:24 +0000 (16:18 -0500)
Sometimes it happens in the tx path that an entry given to the hardware isn't
reported in the txdone handler. This ultimately led to the dreaded "non-free
entry in the non-full queue" message and the stopping of the tx queue. Work
around this issue by allowing the driver to also clear out previos entries in
the txdone handler.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt61pci.c

index 01dbef19d651f14f902805f451afa20246fc01a4..ecae968ce091ef595f2ab5e4e5a0394109da033d 100644 (file)
@@ -1738,6 +1738,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
 {
        struct data_ring *ring;
        struct data_entry *entry;
+       struct data_entry *entry_done;
        struct data_desc *txd;
        u32 word;
        u32 reg;
@@ -1791,6 +1792,17 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
                    !rt2x00_get_field32(word, TXD_W0_VALID))
                        return;
 
+               entry_done = rt2x00_get_data_entry_done(ring);
+               while (entry != entry_done) {
+                       /* Catch up. Just report any entries we missed as
+                        * failed. */
+                       WARNING(rt2x00dev,
+                               "TX status report missed for entry %p\n",
+                               entry_done);
+                       rt2x00lib_txdone(entry_done, TX_FAIL_OTHER, 0);
+                       entry_done = rt2x00_get_data_entry_done(ring);
+               }
+
                /*
                 * Obtain the status about this packet.
                 */