linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Paul Thomas <pthomas8589@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: newbie rtl8187 question
Date: Tue, 20 May 2008 21:24:52 -0400	[thread overview]
Message-ID: <1211333092.11738.18.camel@dv> (raw)
In-Reply-To: <c785bba30805172315q42066fct39e20b35629faa51@mail.gmail.com>

On Sat, 2008-05-17 at 23:15 -0700, Paul Thomas wrote:

> I was finally able to test the driver with an ARM9 (AT91RM9200)
> processor, but I wasn't able to make it work. Here is the error I get:
> 
> kernel BUG at net/core/skbuff.c:149!

There should be a message starting with "skb_under_panic:" immediately
before this.  It prints information about the skb.

> Backtrace:
> [<c0025588>] (__bug+0x0/0x2c) from [<c020ee54>] (skb_under_panic+0x5c/0x68)
> [<c020edf8>] (skb_under_panic+0x0/0x68) from [<c020fce4>] (skb_push+0x3c/0x44)
>  r7:c1d4be40 r6:023a0000 r5:c1d4be40 r4:00000020
> [<c020fca8>] (skb_push+0x0/0x44) from [<c01ae2b8>] (rtl8187_tx+0x200/0x324)
>  r5:00000001 r4:00000001

So, we got there from skb_push().

> [<c01ae0b8>] (rtl8187_tx+0x0/0x324) from [<c02a9d74>]
> (__ieee80211_tx+0x60/0x168)

rtl8187_tx() doesn't call skb_push() directly, but I think that
rtl8187b_tx_buf() got inlined.

Perhaps there is too little headroom space in the skb.  I would check if
dev->extra_tx_headroom is correct in rtl8187_probe().

Try checking the available headroom in rtl8187b_tx_buf() by
skb_headroom().  If it's not enough, use skb_realloc_headroom() and
print how much is missing.

I know there were conflicts between the patch and the latest changes on
linux-wireless.  Maybe you didn't resolve them correctly.

Here's the patch for debugging the panic.

And by the way, please provide the kernel log part from the device
initialization time all the way to the panic.

diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 88e4d4b..8005651 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -185,6 +185,13 @@ static void *rtl8187b_tx_buf(struct sk_buff *skb, __le32 flags,
 			     __le16 tx_dur)
 {
 	struct rtl8187b_tx_hdr *hdr;
+	int need_headroom;
+
+	need_headroom = sizeof(*hdr) - skb_headroom(skb);
+	printk("rtl8187: need headroom: %zd, have %d\n", sizeof(*hdr),
+	       skb_headroom(skb));
+	if (need_headroom)
+		skb = skb_realloc_headroom(skb, need_headroom);
 
 	hdr = (struct rtl8187b_tx_hdr *)skb_push(skb, sizeof(*hdr));
 	memset(hdr, 0, sizeof(*hdr));
@@ -1057,6 +1064,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
 	dev->extra_tx_headroom = (!priv->is_rtl8187b) ?
 				  sizeof(struct rtl8187_tx_hdr) :
 				  sizeof(struct rtl8187b_tx_hdr);
+	printk("rtl8187: need headroom: %d, priv->is_rtl8187b = %d\n",
+	       dev->extra_tx_headroom, priv->is_rtl8187b);
 	if (!priv->is_rtl8187b)
 		dev->queues = 1;
 	else


-- 
Regards,
Pavel Roskin

  reply	other threads:[~2008-05-21  1:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-14  3:14 newbie rtl8187 question Paul Thomas
2008-05-14  3:45 ` Pavel Roskin
     [not found]   ` <c785bba30805132050y51cc3031uae718bc74ade96@mail.gmail.com>
2008-05-14  4:05     ` Pavel Roskin
2008-05-14  4:41       ` Paul Thomas
2008-05-14  4:52         ` Pavel Roskin
2008-05-18  6:15           ` Paul Thomas
2008-05-21  1:24             ` Pavel Roskin [this message]
2008-05-21  6:37               ` Paul Thomas

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=1211333092.11738.18.camel@dv \
    --to=proski@gnu.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pthomas8589@gmail.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).