Search Linux Wireless

Re: newbie rtl8187 question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux