Bug 14000 - prism 2.5 broke in 2.6.30.x
Summary: prism 2.5 broke in 2.6.30.x
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: i386 Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-17 21:10 UTC by Yasen Balev
Modified: 2009-12-18 15:46 UTC (History)
5 users (show)

See Also:
Kernel Version: 2.6.30.x
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
patch to revert the toxic part of the conversion to net_device_ops (1.43 KB, patch)
2009-09-10 22:54 UTC, Martin Decky
Details | Diff

Description Yasen Balev 2009-08-17 21:10:22 UTC
Prism 2.5 wireless card fails as an AP after a kernel upgrade to 2.6.30.1 and later (up to 2.6.30.5).

Not tried with 2.6.30.
Not tried as STA.
The card works well up to kernel 2.6.29.6

To reproduce:
# iwconfig wlan0 mode master
# iwconfig wlan0 chan 4
# iwconfig wlan0 essid ea0
# ifconfig wlan0 192.168.220.254
>now the STA associates>
# tcpdump -i wlan0 -n
<now the STA pings>
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 96 bytes
23:59:36.177209 ARP, Request who-has 192.168.220.254 tell 192.168.220.88, length 28
23:59:36.177287 ARP, Request who-has 192.168.220.254 tell 192.168.220.88, length 28
23:59:36.177306 ARP, Reply 192.168.220.254 is-at 00:e0:00:8d:bd:8e, length 28
23:59:41.610114 ARP, Request who-has 192.168.220.254 tell 192.168.220.88, length 28
23:59:41.610192 ARP, Request who-has 192.168.220.254 tell 192.168.220.88, length 28
23:59:41.610199 ARP, Reply 192.168.220.254 is-at 00:e0:00:8d:bd:8e, length 28
<packets (ARP, at least) flow from STA to AP, but not the other way round>

Related dmesg lines:

[    5.928208] hostap_pci 0000:02:01.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21                                            
[    5.928781] hostap_pci: Registered netdevice wifi0
[    5.928854] wifi0: Original COR value: 0x2
[    6.128188] prism2_hw_init: initialized in 196 ms
[    6.129008] wifi0: NIC: id=0x8013 v1.0.0
[    6.129225] wifi0: PRI: id=0x15 v1.1.1
[    6.129437] wifi0: STA: id=0x1f v1.8.2
[    6.133506] wifi0: Intersil Prism2.5 PCI: mem=0xec000000, irq=21
[    6.134100] wifi0: registered netdevice wlan0
..... (unrelated) .....
[  575.222877] wifi0: deauthentication: 00:0b:6b:35:80:9a len=2, reason_code=3
[  579.638087] wifi0: 00:0b:6b:35:80:9a auth_cb - alg=0 trans#=2 status=0 - STA authenticated
[  579.639151] wifi0: assoc from 00:0b:6b:35:80:9a with extra data (11 bytes) [<dd><09><00><03><7f><01><01><00><00><00><00>]
[  579.740704] wifi0: 00:0b:6b:35:80:9a assoc_cb - STA associated
[  583.017732] Virtual device wifi0 asks to queue packet!
[  588.025832] Virtual device wifi0 asks to queue packet!
[  596.028100] Virtual device wifi0 asks to queue packet!
[  814.920383] Virtual device wifi0 asks to queue packet!
... and so on

OS:
Debian Testing, GCC-4.3.3
Comment 1 Andrew Morton 2009-08-17 21:27:33 UTC
I marked this as a regression.
Comment 2 John W. Linville 2009-08-17 21:59:52 UTC
$ git log v2.6.29..v2.6.30 drivers/net/wireless/hostap/
commit 5ae4efbcd2611562a8b93596be034e63495706a5
Author: Stephen Hemminger <shemminger@vyatta.com>
Date:   Fri Mar 20 19:36:43 2009 +0000

    hostap: convert to net_device_ops
    
    Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 4cfa8e45f4bb26ff38155f94a810a876b739958d
Author: Stephen Hemminger <shemminger@vyatta.com>
Date:   Fri Mar 20 19:36:42 2009 +0000

    hostap: convert to internal net_device_stats
    
    Use pre-existing net_device_stats in network_device struct.
    
    Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 1ea893fde29d8cf1639da8989f4b843dc3283ca8
Author: Dan Williams <dcbw@redhat.com>
Date:   Wed Feb 11 17:17:10 2009 -0500

    hostap: convert usage of net/ieee80211.h to linux/ieee80211.h
    
    So that net/ieee80211.h can be made private to ipw2x00 in a follow-up.
    
    Signed-off-by: Dan Williams <dcbw@redhat.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

commit c1b4aa3fb619782213af2af6652663c8f9cef373
Author: Harvey Harrison <harvey.harrison@gmail.com>
Date:   Thu Jan 29 13:26:44 2009 -0800

    wireless: replace uses of __constant_{endian}
    
    The base versions handle constant folding now.
    
    Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
Comment 3 John W. Linville 2009-08-17 22:02:28 UTC
Yasen, are you git savvy enough to revert each of those patches, rebuild, and give the resulting kernels a try?
Comment 4 Yasen Balev 2009-08-19 09:33:24 UTC
I promise to try this week. Should not be rocket science.
Comment 5 Yasen Balev 2009-08-22 14:57:13 UTC
I reverted the first one 
5ae4efbcd2611562a8b93596be034e63495706a5
and AP started to work. 

Should I try the other ones?
Comment 6 Martin Decky 2009-09-10 22:51:54 UTC
The problem is indeed in commit 5ae4efbcd2611562a8b93596be034e63495706a5.

Have a look into hostap_main.c before the commit. The original fragment of code in the function hostap_setup_dev() was:

if (type != HOSTAP_INTERFACE_MASTER) {
    /* use main radio device queue */
    dev->tx_queue_len = 0;
}

While the equivalent new fragment (with unrelated lines marked) is:

switch(type) {
case HOSTAP_INTERFACE_AP:
    dev->netdev_ops = &hostap_mgmt_netdev_ops;  /* unrelated */
    dev->type = ARPHRD_IEEE80211;               /* unrelated */
    dev->header_ops = &hostap_80211_ops;        /* unrelated */
    break;
case HOSTAP_INTERFACE_MASTER:
    dev->tx_queue_len = 0;                 /* use main radio device queue */
    dev->netdev_ops = &hostap_master_ops;  /* unrelated */
    break;
default:
    dev->netdev_ops = &hostap_netdev_ops;  /* unrelated */
}

Apparently the condition when dev->tx_queue_len should be set to 0 was reversed in the new code, which is wrong.

I have already sent a trivial patch to linux-kernel@vger.kernel.org (see http://lkml.org/lkml/2009/9/9/418). I am also posting the patch here so it won't get lost and somebody applies it ASAP.
Comment 7 Martin Decky 2009-09-10 22:54:01 UTC
Created attachment 23057 [details]
patch to revert the toxic part of the conversion to net_device_ops
Comment 8 Rolf Leggewie 2009-09-18 23:24:19 UTC
I'm usually in managed mode with my Wifi card, connecting to an AP downstairs.  I do get a LOT of warnings in the logs of the form "Virtual device wifi0 asks to queue packet!".  This fills up my /var partition within a day.  Am I being affected by the bug discussed here or is that something else?  Again, this computer is not acting as the AP, but only connecting to one.
Comment 9 Martin Decky 2009-09-19 03:06:11 UTC
(In reply to comment #8)

Although I am not an expert on the hostap driver, I believe that the bug discussed here can affect you also, based on the same reasoning (zero-length queue on wifi0). It's easy to prove or disprove the hypothesis, just use the patch from my comment #7 and recompile your kernel.

The patch should not break anything and it should apply easily to any kernel since 2.6.30. Even if the kernel from your distro is heavily patched, it should be very easy to patch the sources by hand (there are only 3 lines of code to be modified). I can even send you a spec-file for Fedora 11 if you like ..
Comment 10 John W. Linville 2009-09-29 18:31:11 UTC
The patch from comment 7 is in 2.6.32-rc1.  Can you try that and post the results here?  Thanks!
Comment 11 Yasen Balev 2009-10-02 21:12:15 UTC
The patch from comment #7 works for me. Thanks, Martin!
Comment 12 Martin Decky 2009-10-05 22:22:08 UTC
(In reply to comment #10)

2.6.32-rc1 works for me perfectly. Therefore I suggest closing this bug.
Comment 13 Rolf Leggewie 2009-12-17 17:16:49 UTC
Would it be possible to see this patch committed to the 2.6.31 kernel branch?  That was suggested in https://bugs.launchpad.net/ubuntu/+source/linux/+bug/444801/comments/5 as the best way forward for Ubuntu Karmic.
Comment 14 John W. Linville 2009-12-18 15:46:44 UTC
Just forwarded the patch to stable@kernel.org for 2.6.31...

Note You need to log in before you can comment on or make changes to this bug.