From: Bob Copeland <me@bobcopeland.com>
To: Sitsofe Wheeler <sitsofe@yahoo.com>
Cc: Jiri Slaby <jirislaby@gmail.com>,
Nick Kossifidis <mickflemm@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
ath5k-devel@venema.h4ckr.net,
"Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: Re: [TIP] BUG kmalloc-4096: Poison overwritten (ath5k_rx_skb_alloc)
Date: Fri, 20 Mar 2009 09:14:37 -0400 [thread overview]
Message-ID: <20090320131437.GA30120@hash.localnet> (raw)
In-Reply-To: <20090313095213.GA14250@silver.sucs.org>
On Fri, Mar 13, 2009 at 09:52:13AM +0000, Sitsofe Wheeler wrote:
> The dmesg and trace can be found on
> http://sucs.org/~sits/test/eeepc-debug/20090313/ .
Looks like the skb was reused right after it was freed by the mac80211
workqueue so that seems inline with the idea that the list is getting
corrupted somehow. On top of the last patch, would you mind running
this overnight? It'll dump a lot of debug info, I'm really only
interested in the last 5 invocations of ath5k_debug_printrxbuffs or so
before the poison. During a scan you'll see lots of rx_start/rx_stop.
Hmm, I can think of another scenario that could break: if the hw updated
rxdp before DMA completes, then we should check next packet's status too
in case 'current' packet's status is clobbered.
Someone suggested dumping the self links and deal with RXEOL, maybe a
good idea :)
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index a4e385b..e21705c 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1143,8 +1143,10 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
if (!skb) {
skb = ath5k_rx_skb_alloc(sc, &bf->skbaddr);
- if (!skb)
+ if (!skb) {
+ printk(KERN_DEBUG "ath5k: error exit from rxbuf_setup\n");
return -ENOMEM;
+ }
bf->skb = skb;
}
@@ -1561,6 +1563,8 @@ ath5k_rx_start(struct ath5k_softc *sc)
ath5k_mode_setup(sc); /* set filters, etc. */
ath5k_hw_start_rx_pcu(ah); /* re-enable PCU/DMA engine */
+ printk(KERN_DEBUG "ath5k: rx_start\n");
+
return 0;
err:
return ret;
@@ -1578,8 +1582,7 @@ ath5k_rx_stop(struct ath5k_softc *sc)
ath5k_hw_set_rx_filter(ah, 0); /* clear recv filter */
ath5k_hw_stop_rx_dma(ah); /* disable DMA engine */
- ath5k_debug_printrxbuffs(sc, ah);
-
+ printk(KERN_DEBUG "ath5k: rx_stop\n");
sc->rxlink = NULL; /* just in case */
}
@@ -1682,6 +1685,7 @@ ath5k_tasklet_rx(unsigned long data)
int ret;
int hdrlen;
int padsize;
+ static int foo=0;
spin_lock(&sc->rxbuflock);
if (list_empty(&sc->rxbuf)) {
@@ -1689,6 +1693,10 @@ ath5k_tasklet_rx(unsigned long data)
goto unlock;
}
do {
+ /* dump list state every 8 pkts */
+ if (!(foo++ & 7))
+ ath5k_debug_printrxbuffs(sc, sc->ah);
+
rxs.flag = 0;
bf = list_first_entry(&sc->rxbuf, struct ath5k_buf, list);
@@ -2308,6 +2316,8 @@ ath5k_stop_locked(struct ath5k_softc *sc)
} else
sc->rxlink = NULL;
+ printk(KERN_DEBUG "ath5k: rx_stop_locked\n");
+
return 0;
}
@@ -2430,6 +2440,8 @@ ath5k_intr(int irq, void *dev_id)
* least on older hardware revs.
*/
sc->rxlink = NULL;
+ printk(KERN_DEBUG "ath5k: RXEOL\n");
+
}
if (status & AR5K_INT_TXURN) {
/* bump tx trigger level */
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c
index ccaeb5c..c544da5 100644
--- a/drivers/net/wireless/ath5k/debug.c
+++ b/drivers/net/wireless/ath5k/debug.c
@@ -505,7 +505,8 @@ ath5k_debug_printrxbuf(struct ath5k_buf *bf, int done,
struct ath5k_desc *ds = bf->desc;
struct ath5k_hw_all_rx_desc *rd = &ds->ud.ds_rx;
- printk(KERN_DEBUG "R (%p %llx) %08x %08x %08x %08x %08x %08x %c\n",
+ printk(KERN_DEBUG "R %p (%p %llx) %08x %08x %08x %08x %08x %08x %c\n",
+ bf,
ds, (unsigned long long)bf->daddr,
ds->ds_link, ds->ds_data,
rd->rx_ctl.rx_control_0, rd->rx_ctl.rx_control_1,
@@ -518,23 +519,18 @@ ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah)
{
struct ath5k_desc *ds;
struct ath5k_buf *bf;
- struct ath5k_rx_status rs = {};
+ struct ath5k_rx_status rs;
int status;
- if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET)))
- return;
-
printk(KERN_DEBUG "rx queue %x, link %p\n",
ath5k_hw_get_rxdp(ah), sc->rxlink);
- spin_lock_bh(&sc->rxbuflock);
list_for_each_entry(bf, &sc->rxbuf, list) {
ds = bf->desc;
+ memset(&rs, 0, sizeof(struct ath5k_rx_status));
status = ah->ah_proc_rx_desc(ah, ds, &rs);
- if (!status)
- ath5k_debug_printrxbuf(bf, status == 0, &rs);
+ ath5k_debug_printrxbuf(bf, status == 0, &rs);
}
- spin_unlock_bh(&sc->rxbuflock);
}
void
--
Bob Copeland %% www.bobcopeland.com
next prev parent reply other threads:[~2009-03-20 13:14 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-22 11:18 [TIP] BUG kmalloc-4096: Poison overwritten (ath5k_rx_skb_alloc) Sitsofe Wheeler
2009-02-22 12:01 ` Jiri Slaby
2009-02-22 12:20 ` Sitsofe Wheeler
2009-02-22 12:47 ` Jiri Slaby
2009-02-22 14:47 ` Frederic Weisbecker
2009-02-22 17:02 ` Sitsofe Wheeler
2009-02-22 17:10 ` Frederic Weisbecker
2009-02-22 19:27 ` Jiri Slaby
2009-02-22 19:42 ` Frederic Weisbecker
2009-02-22 20:18 ` Sitsofe Wheeler
2009-02-22 20:27 ` Jiri Slaby
2009-02-22 20:30 ` Frederic Weisbecker
2009-02-22 21:56 ` Jiri Slaby
2009-02-22 22:21 ` Sitsofe Wheeler
2009-02-22 23:20 ` Jiri Slaby
2009-02-23 15:35 ` Bob Copeland
2009-02-23 16:03 ` Nick Kossifidis
2009-02-23 16:15 ` Nick Kossifidis
2009-02-23 16:21 ` Bob Copeland
2009-02-23 16:27 ` Nick Kossifidis
2009-02-23 16:30 ` Bob Copeland
2009-02-23 16:41 ` Nick Kossifidis
2009-02-23 16:44 ` Bob Copeland
2009-02-23 16:16 ` pat-lkml
2009-02-23 16:20 ` Nick Kossifidis
2009-02-23 22:22 ` Jiri Slaby
2009-02-23 22:43 ` Jiri Slaby
2009-02-23 23:08 ` Nick Kossifidis
2009-02-24 13:58 ` Bob Copeland
2009-02-24 21:47 ` Jiri Slaby
2009-02-25 14:01 ` Sitsofe Wheeler
2009-02-26 1:06 ` Bob Copeland
2009-02-26 20:53 ` Jiri Slaby
2009-02-26 21:05 ` Bob Copeland
2009-02-26 13:59 ` Bob Copeland
2009-02-26 17:03 ` Sitsofe Wheeler
2009-03-02 17:34 ` [ath5k-devel] " Bob Copeland
2009-03-03 4:12 ` Bob Copeland
2009-03-03 20:03 ` Sitsofe Wheeler
2009-03-04 12:07 ` Bob Copeland
2009-03-06 9:42 ` Sitsofe Wheeler
2009-03-07 4:47 ` Bob Copeland
2009-03-07 8:04 ` Sitsofe Wheeler
2009-03-07 13:34 ` Bob Copeland
2009-03-08 3:09 ` Bob Copeland
2009-03-08 9:28 ` Jiri Slaby
2009-03-08 16:10 ` Bob Copeland
2009-03-10 0:43 ` Bob Copeland
2009-03-10 8:19 ` Sitsofe Wheeler
2009-03-12 6:10 ` Sitsofe Wheeler
2009-03-13 9:52 ` Sitsofe Wheeler
2009-03-13 12:28 ` Bob Copeland
2009-03-20 13:14 ` Bob Copeland [this message]
2009-03-29 14:24 ` Sitsofe Wheeler
2009-03-29 15:14 ` Bob Copeland
2009-03-31 8:30 ` Sitsofe Wheeler
2009-05-13 21:44 ` Sitsofe Wheeler
2009-05-15 4:09 ` Bob Copeland
2009-05-18 10:05 ` Sitsofe Wheeler
2009-05-22 9:39 ` Sitsofe Wheeler
2009-05-22 12:06 ` Bob Copeland
2009-05-26 21:10 ` Sitsofe Wheeler
2009-06-28 20:23 ` Sitsofe Wheeler
2009-07-14 2:24 ` Bob Copeland
2009-02-26 1:11 ` Bob Copeland
2009-02-22 20:17 ` Bob Copeland
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=20090320131437.GA30120@hash.localnet \
--to=me@bobcopeland.com \
--cc=ath5k-devel@venema.h4ckr.net \
--cc=fweisbec@gmail.com \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lrodriguez@atheros.com \
--cc=mickflemm@gmail.com \
--cc=sitsofe@yahoo.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).