Commit efd82118 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

rt2x00usb: fix indexes ordering on RX queue kick

On rt2x00_dmastart() we increase index specified by Q_INDEX and on
rt2x00_dmadone() we increase index specified by Q_INDEX_DONE. So entries
between Q_INDEX_DONE and Q_INDEX are those we currently process in the
hardware. Entries between Q_INDEX and Q_INDEX_DONE are those we can
submit to the hardware.

According to that fix rt2x00usb_kick_queue(), as we need to submit RX
entries that are not processed by the hardware. It worked before only
for empty queue, otherwise was broken.

Note that for TX queues indexes ordering are ok. We need to kick entries
that have filled skb, but was not submitted to the hardware, i.e.
started from Q_INDEX_DONE and have ENTRY_DATA_PENDING bit set.

From practical standpoint this fixes RX queue stall, usually reproducible
in AP mode, like for example reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=828824Reported-and-tested-by: default avatarFranco Miceli <fmiceli@plan.ceibal.edu.uy>
Reported-and-tested-by: default avatarTom Horsley <horsley1953@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b3190466
...@@ -436,8 +436,8 @@ void rt2x00usb_kick_queue(struct data_queue *queue) ...@@ -436,8 +436,8 @@ void rt2x00usb_kick_queue(struct data_queue *queue)
case QID_RX: case QID_RX:
if (!rt2x00queue_full(queue)) if (!rt2x00queue_full(queue))
rt2x00queue_for_each_entry(queue, rt2x00queue_for_each_entry(queue,
Q_INDEX_DONE,
Q_INDEX, Q_INDEX,
Q_INDEX_DONE,
NULL, NULL,
rt2x00usb_kick_rx_entry); rt2x00usb_kick_rx_entry);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment