2008-09-25 19:56:04

by Hauke Mehrtens

[permalink] [raw]
Subject: Kernel panic in wireless-testing-2008-09-24 with rtl8187

After upgrading from wireless-testing-2008-09-12 to
wireless-testing-2008-09-24 I got the following kernel panic short after
starting linux.

It happens at every start. After starting an older linux version
everything works as it should.

I think it happens in the connecting process.

I am using Ubuntu Hardy with network manager 0.7
I have got an rtl8187 chip on my Asus P5B Deluxe wifi.

Hauke


Attachments:
kernel-panic-rtl8187.jpg (209.78 kB)

2008-09-25 21:17:57

by Larry Finger

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

Hauke Mehrtens wrote:
> After upgrading from wireless-testing-2008-09-12 to
> wireless-testing-2008-09-24 I got the following kernel panic short after
> starting linux.
>
> It happens at every start. After starting an older linux version
> everything works as it should.
>
> I think it happens in the connecting process.
>
> I am using Ubuntu Hardy with network manager 0.7
> I have got an rtl8187 chip on my Asus P5B Deluxe wifi.

I can confirm this with and without my RTL8187B inserted.

Larry


2008-09-26 06:50:59

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Thu, Sep 25, 2008 at 11:42 PM, Tomas Winkler <[email protected]> wrote:
> On Fri, Sep 26, 2008 at 6:06 AM, Larry Finger <[email protected]> wrote:
>> Tomas Winkler wrote:
>>> wild guess try to revert:
>>> 'mac80211: make master iface not wireless'
>>
>> You win the prize. Bisection shows that
>> 84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit
>>
>> commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
>> Author: Johannes Berg <[email protected]>
>> Date: Tue Sep 16 14:18:59 2008 +0200
>>
>> mac80211: make master iface not wireless
>>
>>
>> The actual crash is in the following routine from include/net/wireless.h:
>>
>> /**
>> * wiphy_priv - return priv from wiphy
>> */
>> static inline void *wiphy_priv(struct wiphy *wiphy)
>> {
>> BUG_ON(!wiphy);
>> return &wiphy->priv;
>> }
>>
>> I'm still looking to see where it goes wrong.
>
> What do you mean? The root cause is written in the commit log.
> Tomas

The question is who calls wiphy_priv(mdev) or wiphy_priv(NULL) and where.

Luis

2008-09-26 06:51:34

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Thu, Sep 25, 2008 at 11:50 PM, Luis R. Rodriguez <[email protected]> wrote:
> On Thu, Sep 25, 2008 at 11:42 PM, Tomas Winkler <[email protected]> wrote:
>> On Fri, Sep 26, 2008 at 6:06 AM, Larry Finger <[email protected]> wrote:
>>> Tomas Winkler wrote:
>>>> wild guess try to revert:
>>>> 'mac80211: make master iface not wireless'
>>>
>>> You win the prize. Bisection shows that
>>> 84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit
>>>
>>> commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
>>> Author: Johannes Berg <[email protected]>
>>> Date: Tue Sep 16 14:18:59 2008 +0200
>>>
>>> mac80211: make master iface not wireless
>>>
>>>
>>> The actual crash is in the following routine from include/net/wireless.h:
>>>
>>> /**
>>> * wiphy_priv - return priv from wiphy
>>> */
>>> static inline void *wiphy_priv(struct wiphy *wiphy)
>>> {
>>> BUG_ON(!wiphy);
>>> return &wiphy->priv;
>>> }
>>>
>>> I'm still looking to see where it goes wrong.
>>
>> What do you mean? The root cause is written in the commit log.
>> Tomas
>
> The question is who calls wiphy_priv(mdev) or wiphy_priv(NULL) and where.

Actually just the later.

Luis

2008-09-25 23:14:51

by Pavel Roskin

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Thu, 2008-09-25 at 21:26 +0200, Hauke Mehrtens wrote:
> After upgrading from wireless-testing-2008-09-12 to
> wireless-testing-2008-09-24 I got the following kernel panic short after
> starting linux.

Same thing here. Also in ieee80211_select_queue. Fedora Development,
x86_64, current wireless-testing/master. The system where it happens
has b43, b43legacy and rt61pci compiled as modules, they all are loaded
on startup, and there are supported cards for all of them.

Due to a finicky video card, I cannot use more than 25 lines on the
terminal, so I don't see if there is a BUG before the trace in my case.

--
Regards,
Pavel Roskin

2008-09-27 11:49:42

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

John W. Linville wrote:
> I have applied Johannes's fix (slightly more complete than the one
> from Luis) to wireless-testing, and it is available now. Please verify
> that it is working for you.

Thanks for the patch. It loads and connects to the wireless network like
with older kernels.

Hauke

2008-09-26 08:47:47

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Fri, Sep 26, 2008 at 01:11:53AM -0700, Tomas Winkler wrote:
> On Fri, Sep 26, 2008 at 10:43 AM, Luis R. Rodriguez <[email protected]> wrote:
> > On Fri, Sep 26, 2008 at 12:06 AM, Luis R. Rodriguez <[email protected]> wrote:
> >> On Thu, Sep 25, 2008 at 8:06 PM, Larry Finger <[email protected]> wrote:
> >>> Tomas Winkler wrote:
> >>>> wild guess try to revert:
> >>>> 'mac80211: make master iface not wireless'
> >>>
> >>> You win the prize. Bisection shows that
> >>> 84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit
> >>>
> >>> commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
> >>> Author: Johannes Berg <[email protected]>
> >>> Date: Tue Sep 16 14:18:59 2008 +0200
> >>>
> >>> mac80211: make master iface not wireless
> >>>
> >>>
> >>> The actual crash is in the following routine from include/net/wireless.h:
> >>>
> >>> /**
> >>> * wiphy_priv - return priv from wiphy
> >>> */
> >>> static inline void *wiphy_priv(struct wiphy *wiphy)
> >>> {
> >>> BUG_ON(!wiphy);
> >>> return &wiphy->priv;
> >>> }
> >>>
> >>> I'm still looking to see where it goes wrong.
> >>
> >> Actually wouldn't you get a stack trace here?
> >
> > Yeah not sure I tested against !wiphy on its callers and didn't find a
> > case where it hit. I don't think this is it.
>
> u16 ieee80211_select_queue(struct net_device *dev, struct sk_buff *skb)
> {
> struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
> struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> --- this is the line

--- This is the fix

diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 6748ded..7d114bd 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -75,8 +75,16 @@ static int wme_downgrade_ac(struct sk_buff *skb)
/* Indicate which queue to use. */
static u16 classify80211(struct sk_buff *skb, struct net_device *dev)
{
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ struct ieee80211_local *local;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+ struct ieee80211_master_priv *mpriv;
+
+ /* this is not for wiphys, just for mdev */
+ BUG_ON (dev->ieee80211_ptr);
+
+ mpriv = netdev_priv(dev);
+ local = mpriv->local;
+

if (!ieee80211_is_data(hdr->frame_control)) {
/* management frames go on AC_VO queue, but are sent
@@ -114,12 +122,19 @@ static u16 classify80211(struct sk_buff *skb, struct net_device *dev)
u16 ieee80211_select_queue(struct net_device *dev, struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ struct ieee80211_local *local;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ struct ieee80211_master_priv *mpriv;
struct sta_info *sta;
u16 queue;
u8 tid;

+ /* this is not for wiphys, just for mdev */
+ BUG_ON (dev->ieee80211_ptr);
+
+ mpriv = netdev_priv(dev);
+ local = mpriv->local;
+
queue = classify80211(skb, dev);
if (unlikely(queue >= local->hw.queues))
queue = local->hw.queues - 1;

2008-09-25 21:36:27

by Tomas Winkler

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Fri, Sep 26, 2008 at 12:18 AM, Larry Finger
<[email protected]> wrote:
> Hauke Mehrtens wrote:
>> After upgrading from wireless-testing-2008-09-12 to
>> wireless-testing-2008-09-24 I got the following kernel panic short after
>> starting linux.
>>
>> It happens at every start. After starting an older linux version
>> everything works as it should.
>>
>> I think it happens in the connecting process.
>>
>> I am using Ubuntu Hardy with network manager 0.7
>> I have got an rtl8187 chip on my Asus P5B Deluxe wifi.
>
> I can confirm this with and without my RTL8187B inserted.
>
> Larry
>
wild guess try to revert:
'mac80211: make master iface not wireless'

Tomas

2008-09-26 07:43:24

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Fri, Sep 26, 2008 at 12:06 AM, Luis R. Rodriguez <[email protected]> wrote:
> On Thu, Sep 25, 2008 at 8:06 PM, Larry Finger <[email protected]> wrote:
>> Tomas Winkler wrote:
>>> wild guess try to revert:
>>> 'mac80211: make master iface not wireless'
>>
>> You win the prize. Bisection shows that
>> 84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit
>>
>> commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
>> Author: Johannes Berg <[email protected]>
>> Date: Tue Sep 16 14:18:59 2008 +0200
>>
>> mac80211: make master iface not wireless
>>
>>
>> The actual crash is in the following routine from include/net/wireless.h:
>>
>> /**
>> * wiphy_priv - return priv from wiphy
>> */
>> static inline void *wiphy_priv(struct wiphy *wiphy)
>> {
>> BUG_ON(!wiphy);
>> return &wiphy->priv;
>> }
>>
>> I'm still looking to see where it goes wrong.
>
> Actually wouldn't you get a stack trace here?

Yeah not sure I tested against !wiphy on its callers and didn't find a
case where it hit. I don't think this is it.

Luis

2008-09-26 08:12:27

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Fri, Sep 26, 2008 at 1:11 AM, Tomas Winkler <[email protected]> wrote:
> On Fri, Sep 26, 2008 at 10:43 AM, Luis R. Rodriguez <[email protected]> wrote:
>> On Fri, Sep 26, 2008 at 12:06 AM, Luis R. Rodriguez <[email protected]> wrote:
>>> On Thu, Sep 25, 2008 at 8:06 PM, Larry Finger <[email protected]> wrote:
>>>> Tomas Winkler wrote:
>>>>> wild guess try to revert:
>>>>> 'mac80211: make master iface not wireless'
>>>>
>>>> You win the prize. Bisection shows that
>>>> 84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit
>>>>
>>>> commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
>>>> Author: Johannes Berg <[email protected]>
>>>> Date: Tue Sep 16 14:18:59 2008 +0200
>>>>
>>>> mac80211: make master iface not wireless
>>>>
>>>>
>>>> The actual crash is in the following routine from include/net/wireless.h:
>>>>
>>>> /**
>>>> * wiphy_priv - return priv from wiphy
>>>> */
>>>> static inline void *wiphy_priv(struct wiphy *wiphy)
>>>> {
>>>> BUG_ON(!wiphy);
>>>> return &wiphy->priv;
>>>> }
>>>>
>>>> I'm still looking to see where it goes wrong.
>>>
>>> Actually wouldn't you get a stack trace here?
>>
>> Yeah not sure I tested against !wiphy on its callers and didn't find a
>> case where it hit. I don't think this is it.
>
> u16 ieee80211_select_queue(struct net_device *dev, struct sk_buff *skb)
> {
> struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
> struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> --- this is the line

Yeah I just landed there too.

Luis

2008-09-26 07:06:16

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Thu, Sep 25, 2008 at 8:06 PM, Larry Finger <[email protected]> wrote:
> Tomas Winkler wrote:
>> wild guess try to revert:
>> 'mac80211: make master iface not wireless'
>
> You win the prize. Bisection shows that
> 84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit
>
> commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
> Author: Johannes Berg <[email protected]>
> Date: Tue Sep 16 14:18:59 2008 +0200
>
> mac80211: make master iface not wireless
>
>
> The actual crash is in the following routine from include/net/wireless.h:
>
> /**
> * wiphy_priv - return priv from wiphy
> */
> static inline void *wiphy_priv(struct wiphy *wiphy)
> {
> BUG_ON(!wiphy);
> return &wiphy->priv;
> }
>
> I'm still looking to see where it goes wrong.

Actually wouldn't you get a stack trace here?

Luis

2008-09-26 03:06:20

by Larry Finger

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

Tomas Winkler wrote:
> wild guess try to revert:
> 'mac80211: make master iface not wireless'

You win the prize. Bisection shows that
84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit

commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
Author: Johannes Berg <[email protected]>
Date: Tue Sep 16 14:18:59 2008 +0200

mac80211: make master iface not wireless


The actual crash is in the following routine from include/net/wireless.h:

/**
* wiphy_priv - return priv from wiphy
*/
static inline void *wiphy_priv(struct wiphy *wiphy)
{
BUG_ON(!wiphy);
return &wiphy->priv;
}

I'm still looking to see where it goes wrong.

Larry


2008-09-26 16:29:11

by John W. Linville

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Thu, Sep 25, 2008 at 09:26:32PM +0200, Hauke Mehrtens wrote:
> After upgrading from wireless-testing-2008-09-12 to
> wireless-testing-2008-09-24 I got the following kernel panic short after
> starting linux.
>
> It happens at every start. After starting an older linux version
> everything works as it should.
>
> I think it happens in the connecting process.
>
> I am using Ubuntu Hardy with network manager 0.7
> I have got an rtl8187 chip on my Asus P5B Deluxe wifi.

I have applied Johannes's fix (slightly more complete than the one
from Luis) to wireless-testing, and it is available now. Please verify
that it is working for you.

Thanks!

John
--
John W. Linville Linux should be at the core
[email protected] of your literate lifestyle.

2008-09-26 08:11:55

by Tomas Winkler

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Fri, Sep 26, 2008 at 10:43 AM, Luis R. Rodriguez <[email protected]> wrote:
> On Fri, Sep 26, 2008 at 12:06 AM, Luis R. Rodriguez <[email protected]> wrote:
>> On Thu, Sep 25, 2008 at 8:06 PM, Larry Finger <[email protected]> wrote:
>>> Tomas Winkler wrote:
>>>> wild guess try to revert:
>>>> 'mac80211: make master iface not wireless'
>>>
>>> You win the prize. Bisection shows that
>>> 84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit
>>>
>>> commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
>>> Author: Johannes Berg <[email protected]>
>>> Date: Tue Sep 16 14:18:59 2008 +0200
>>>
>>> mac80211: make master iface not wireless
>>>
>>>
>>> The actual crash is in the following routine from include/net/wireless.h:
>>>
>>> /**
>>> * wiphy_priv - return priv from wiphy
>>> */
>>> static inline void *wiphy_priv(struct wiphy *wiphy)
>>> {
>>> BUG_ON(!wiphy);
>>> return &wiphy->priv;
>>> }
>>>
>>> I'm still looking to see where it goes wrong.
>>
>> Actually wouldn't you get a stack trace here?
>
> Yeah not sure I tested against !wiphy on its callers and didn't find a
> case where it hit. I don't think this is it.

u16 ieee80211_select_queue(struct net_device *dev, struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
--- this is the line

Tomas

2008-09-25 20:09:43

by John W. Linville

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Thu, Sep 25, 2008 at 09:26:32PM +0200, Hauke Mehrtens wrote:
> After upgrading from wireless-testing-2008-09-12 to
> wireless-testing-2008-09-24 I got the following kernel panic short after
> starting linux.
>
> It happens at every start. After starting an older linux version
> everything works as it should.
>
> I think it happens in the connecting process.
>
> I am using Ubuntu Hardy with network manager 0.7
> I have got an rtl8187 chip on my Asus P5B Deluxe wifi.

Could you try master-2008-09-22 and master-2008-09-23 as well?
That might help to isolate the issue.

Thanks!

John
--
John W. Linville Linux should be at the core
[email protected] of your literate lifestyle.

2008-09-26 06:42:49

by Tomas Winkler

[permalink] [raw]
Subject: Re: Kernel panic in wireless-testing-2008-09-24 with rtl8187

On Fri, Sep 26, 2008 at 6:06 AM, Larry Finger <[email protected]> wrote:
> Tomas Winkler wrote:
>> wild guess try to revert:
>> 'mac80211: make master iface not wireless'
>
> You win the prize. Bisection shows that
> 84b0ba8ed0423a3c56a28e701b735daae3e15766 is first bad commit
>
> commit 84b0ba8ed0423a3c56a28e701b735daae3e15766
> Author: Johannes Berg <[email protected]>
> Date: Tue Sep 16 14:18:59 2008 +0200
>
> mac80211: make master iface not wireless
>
>
> The actual crash is in the following routine from include/net/wireless.h:
>
> /**
> * wiphy_priv - return priv from wiphy
> */
> static inline void *wiphy_priv(struct wiphy *wiphy)
> {
> BUG_ON(!wiphy);
> return &wiphy->priv;
> }
>
> I'm still looking to see where it goes wrong.

What do you mean? The root cause is written in the commit log.
Tomas