]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath5k: Count how many times a queue got stuck
authorBruno Randolf <br1@einfach.org>
Fri, 17 Sep 2010 02:37:02 +0000 (11:37 +0900)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 21 Sep 2010 15:05:14 +0000 (11:05 -0400)
Add a counter to show how many times a queue got stuck in the debugfs queue
file.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath5k/base.h
drivers/net/wireless/ath/ath5k/debug.c

index afedfeba13ddc5d1a1f5983bbc9e15e2a21361ff..cae9fe4676e712d91401631a58554812dbd659f1 100644 (file)
@@ -892,6 +892,7 @@ ath5k_txq_setup(struct ath5k_softc *sc,
                txq->setup = true;
                txq->txq_len = 0;
                txq->txq_poll_mark = false;
+               txq->txq_stuck = 0;
        }
        return &sc->txqs[qnum];
 }
@@ -2193,6 +2194,7 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
                                                  "TX queue stuck %d\n",
                                                  txq->qnum);
                                        needreset = true;
+                                       txq->txq_stuck++;
                                        spin_unlock_bh(&txq->lock);
                                        break;
                                } else {
index d8e2674aec71d0bf1cbfd6c343fc01bfd3be64f6..7f9d0d3018e81a2b40b026808bf6373516e0d002 100644 (file)
@@ -88,6 +88,7 @@ struct ath5k_txq {
        bool                    setup;
        int                     txq_len; /* number of queued buffers */
        bool                    txq_poll_mark;
+       unsigned int            txq_stuck;      /* informational counter */
 };
 
 #define ATH5K_LED_MAX_NAME_LEN 31
index b2c610ba8b7e34badd131b2eefa5d48e3719b528..6583a82a0783255496ec72e17ea220153fafa296 100644 (file)
@@ -785,6 +785,8 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
 
                len += snprintf(buf+len, sizeof(buf)-len,
                                "  len: %d bufs: %d\n", txq->txq_len, n);
+               len += snprintf(buf+len, sizeof(buf)-len,
+                               "  stuck: %d\n", txq->txq_stuck);
        }
 
        if (len > sizeof(buf))