Josh Boyer 83ef0f3
From e899a84a6e9bec0ce653713a48ca121cd754430c Mon Sep 17 00:00:00 2001
Josh Boyer 83ef0f3
From: Stanislaw Gruszka <sgruszka@redhat.com>
Josh Boyer 83ef0f3
Date: Mon, 2 Jul 2012 09:42:14 +0200
Josh Boyer 83ef0f3
Subject: [PATCH] rt2x00usb: fix indexes ordering on RX queue kick
Josh Boyer 83ef0f3
Josh Boyer 83ef0f3
On rt2x00_dmastart() we increase index specified by Q_INDEX and on
Josh Boyer 83ef0f3
rt2x00_dmadone() we increase index specified by Q_INDEX_DONE. So entries
Josh Boyer 83ef0f3
between Q_INDEX_DONE and Q_INDEX are those we currently process in the
Josh Boyer 83ef0f3
hardware. Entries between Q_INDEX and Q_INDEX_DONE are those we can
Josh Boyer 83ef0f3
submit to the hardware.
Josh Boyer 83ef0f3
Josh Boyer 83ef0f3
According to that fix rt2x00usb_kick_queue(), as we need to submit rx
Josh Boyer 83ef0f3
entries that are not processed by the hardware. It worked before only
Josh Boyer 83ef0f3
for empty queue, otherwise was broken.
Josh Boyer 83ef0f3
Josh Boyer 83ef0f3
Note that for TX queues indexes ordering are ok. We need to kick entries
Josh Boyer 83ef0f3
that have filled skb, but was not submitted to the hardware, i.e.
Josh Boyer 83ef0f3
strted from Q_INDEX_DONE and have ENTRY_DATA_PENDING bit set.
Josh Boyer 83ef0f3
Josh Boyer 83ef0f3
From practical standpoint this patch fixes AP mode connection hangs.
Josh Boyer 83ef0f3
Josh Boyer 83ef0f3
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Josh Boyer 83ef0f3
---
Josh Boyer 83ef0f3
 drivers/net/wireless/rt2x00/rt2x00usb.c |    2 +-
Josh Boyer 83ef0f3
 1 files changed, 1 insertions(+), 1 deletions(-)
Josh Boyer 83ef0f3
Josh Boyer 83ef0f3
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
Josh Boyer 83ef0f3
index d357d1e..74ecc33 100644
Josh Boyer 83ef0f3
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
Josh Boyer 83ef0f3
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
Josh Boyer 83ef0f3
@@ -436,8 +436,8 @@ void rt2x00usb_kick_queue(struct data_queue *queue)
Josh Boyer 83ef0f3
 	case QID_RX:
Josh Boyer 83ef0f3
 		if (!rt2x00queue_full(queue))
Josh Boyer 83ef0f3
 			rt2x00queue_for_each_entry(queue,
Josh Boyer 83ef0f3
-						   Q_INDEX_DONE,
Josh Boyer 83ef0f3
 						   Q_INDEX,
Josh Boyer 83ef0f3
+						   Q_INDEX_DONE,
Josh Boyer 83ef0f3
 						   NULL,
Josh Boyer 83ef0f3
 						   rt2x00usb_kick_rx_entry);
Josh Boyer 83ef0f3
 		break;
Josh Boyer 83ef0f3
-- 
Josh Boyer 83ef0f3
1.7.1
Josh Boyer 83ef0f3