Skip to contentSkip to conversation

ath9k: Restart xmit logic in xmit watchdog.

PATCH New greearb at candelatech.com 1 participant 1 message Jan 10, 2011 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ath9k: Restart xmit logic in xmit watchdog.

From: Ben Greear <[email protected]>

The system can get into a state where the xmit queue is stopped, but there are no packets pending, so the queue will not be restarted.

Add logic to the xmit watchdog to attempt to restart the xmit logic if this situation is detected.

Example 'dmesg' output:

ath: txq: f4e723e0 axq_qnum: 2, mac80211_qnum: 2 axq_link: f4e996c8 pending frames: 1 axq_acq empty: 1 stopped: 0 axq_depth: 0 Attempting to restart tx logic.

---
v1 -> v2: Add mac80211_qnum to ath_txq structure for
easy mapping from txq back to mac80211-qnum. Clean up wake-queue logic to make use of this. Add some comments to try to make the queue logic more easily understood. Fix typo in printk message.

:100644 100644 93209d6... 35f17fc... M drivers/net/wireless/ath/ath9k/ath9k.h
:100644 100644 9e009cc... b0cb792... M drivers/net/wireless/ath/ath9k/debug.c
:100644 100644 59c01ca... 5279653... M drivers/net/wireless/ath/ath9k/init.c
:100644 100644 d9a4144... 14eeac4... M drivers/net/wireless/ath/ath9k/xmit.c

 drivers/net/wireless/ath/ath9k/ath9k.h |    9 +++-
 drivers/net/wireless/ath/ath9k/debug.c |    4 +-
 drivers/net/wireless/ath/ath9k/init.c  |    5 +-
 drivers/net/wireless/ath/ath9k/xmit.c  |   79 ++++++++++++++++++++++----------
 4 files changed, 68 insertions(+), 29 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +8 -1
index 93209d6..35f17fc 100644
@@ -184,7 +184,8 @@ enum ATH_AGGR_STATUS {
 
 #define ATH_TXFIFO_DEPTH 8
 struct ath_txq {
-	u32 axq_qnum;
+	int mac80211_qnum; /* mac80211 queue number, -1 means not mac80211 Q */
+	u32 axq_qnum; /* ath9k hardware queue number */
 	u32 *axq_link;
 	struct list_head axq_q;
 	spinlock_t axq_lock;
@@ -281,6 +282,11 @@ struct ath_tx_control {
 #define ATH_TX_XRETRY       0x02
 #define ATH_TX_BAR          0x04
 
+/**
+ * @txq_map:  Index is mac80211 queue number.  This is
+ *  not necessarily the same as the hardware queue number
+ *  (axq_qnum).
+ */
 struct ath_tx {
 	u16 seq_no;
 	u32 txqsetup;
@@ -630,6 +636,7 @@ struct ath_softc {
 	struct ath9k_debug debug;
 	spinlock_t nodes_lock;
 	struct list_head nodes; /* basically, stations */
+	unsigned int tx_complete_poll_work_seen;
 #endif
 	struct ath_beacon_config cur_beacon_conf;
 	struct delayed_work tx_complete_work;
drivers/net/wireless/ath/ath9k/debug.c +3 -1
index 9e009cc..b0cb792 100644
@@ -629,9 +629,11 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
 	if (buf == NULL)
 		return -ENOMEM;
 
-	len += sprintf(buf, "Num-Tx-Queues: %i  tx-queues-setup: 0x%x\n"
+	len += sprintf(buf, "Num-Tx-Queues: %i  tx-queues-setup: 0x%x"
+		       " poll-work-seen: %u\n"
 		       "%30s %10s%10s%10s\n\n",
 		       ATH9K_NUM_TX_QUEUES, sc->tx.txqsetup,
+		       sc->tx_complete_poll_work_seen,
 		       "BE", "BK", "VI", "VO");
 
 	PR("MPDUs Queued:    ", queued);
drivers/net/wireless/ath/ath9k/init.c +3 -2
index 59c01ca..5279653 100644
@@ -442,9 +442,10 @@ static int ath9k_init_queues(struct ath_softc *sc)
 	sc->config.cabqReadytime = ATH_CABQ_READY_TIME;
 	ath_cabq_update(sc);
 
-	for (i = 0; i < WME_NUM_AC; i++)
+	for (i = 0; i < WME_NUM_AC; i++) {
 		sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i);
-
+		sc->tx.txq_map[i]->mac80211_qnum = i;
+	}
 	return 0;
 }
 
drivers/net/wireless/ath/ath9k/xmit.c +54 -25

148 lines not on this page · raw message

Signature · 1 line
1.7.2.3