linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bruno Randolf <br1@einfach.org>
To: linville@tuxdriver.com
Cc: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org
Subject: [PATCH 2/9] ath5k: Fix queue debug file
Date: Thu, 16 Sep 2010 18:51:23 +0900	[thread overview]
Message-ID: <20100916095123.17637.43751.stgit@tt-desk> (raw)
In-Reply-To: <20100916095112.17637.17207.stgit@tt-desk>

Take txq lock in debug file and fix reporting of used buffers.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 drivers/net/wireless/ath/ath5k/debug.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 1b7c6d7..b2c610b 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -763,7 +763,7 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
 
 	struct ath5k_txq *txq;
 	struct ath5k_buf *bf, *bf0;
-	int i, n = 0;
+	int i, n;
 
 	len += snprintf(buf+len, sizeof(buf)-len,
 			"available txbuffers: %d\n", sc->txbuf_len);
@@ -777,9 +777,14 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
 		if (!txq->setup)
 			continue;
 
+		n = 0;
+		spin_lock_bh(&txq->lock);
 		list_for_each_entry_safe(bf, bf0, &txq->q, list)
 			n++;
-		len += snprintf(buf+len, sizeof(buf)-len, "  len: %d\n", n);
+		spin_unlock_bh(&txq->lock);
+
+		len += snprintf(buf+len, sizeof(buf)-len,
+				"  len: %d bufs: %d\n", txq->txq_len, n);
 	}
 
 	if (len > sizeof(buf))


  parent reply	other threads:[~2010-09-16  9:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16  9:51 [PATCH 0/9] ath5: Add multiple queues / QoS support Bruno Randolf
2010-09-16  9:51 ` [PATCH 1/9] ath5k: Use four hardware queues Bruno Randolf
2010-09-16  9:51 ` Bruno Randolf [this message]
2010-09-16  9:51 ` [PATCH 3/9] ath5k: Fix TX queues stopping Bruno Randolf
2010-09-16  9:51 ` [PATCH 4/9] ath5k: Move tx frame completion into separate function Bruno Randolf
2010-09-16  9:51 ` [PATCH 5/9] ath5k: Add watchdog for stuck TX queues Bruno Randolf
2010-09-16  9:51 ` [PATCH 6/9] ath5k: Count how many times a queue got stuck Bruno Randolf
2010-09-16  9:51 ` [PATCH 7/9] ath5k: Keep last descriptor in queue Bruno Randolf
2010-09-16  9:51 ` [PATCH 8/9] ath5k: Simplify cw_min/max and AIFS configuration Bruno Randolf
2010-09-16  9:52 ` [PATCH 9/9] ath5k: Add tx queue configuration function Bruno Randolf
2010-09-16 19:38 ` [PATCH 0/9] ath5: Add multiple queues / QoS support John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100916095123.17637.43751.stgit@tt-desk \
    --to=br1@einfach.org \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).