Bug 32092

Summary: Regression in zd1211rw
Product: Drivers Reporter: jcallen
Component: network-wirelessAssignee: Jussi Kivilinna (jussi.kivilinna)
Status: CLOSED CODE_FIX    
Severity: normal CC: florian, jussi.kivilinna, stf_xl
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.38 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: zd1211rw: make zd_usb_iowrite16v_async() handle bulk endpoints correctly
lsusb -vvv output
dmesg output
Remove bogus URB flag and add buffer len check to URB completion handler.
kernel backtrace
Fixes WARNING caused by zd_usb_reset_rx_idle_timer/del_timer_sync

Description jcallen 2011-03-29 05:23:58 UTC
Starting with commit eefdbec1ea8b, my wireless card using the zd1211rw driver fails to connect to an access point.

The card appears in lsusb as "ID 07b8:6001 AboCom Systems Inc 802.11bg".
Comment 1 Jussi Kivilinna 2011-03-29 07:32:01 UTC
Can you provide 'lsusb -vvv' on this device?
Comment 2 Jussi Kivilinna 2011-03-29 07:39:21 UTC
Also 'dmesg' might help solving this.
Comment 3 Jussi Kivilinna 2011-03-29 11:05:08 UTC
Created attachment 52442 [details]
zd1211rw: make zd_usb_iowrite16v_async() handle bulk endpoints correctly

Found 'lsusb -vvv' for this device from Internet and seems that this device has different type of endpoint than expected (bulk instead of interrupt).

Please test this patch, it handles both endpoint types now.
Comment 4 jcallen 2011-03-29 18:58:15 UTC
Created attachment 52522 [details]
lsusb -vvv output

Attached is the lsusb -vvv output for this device (just in case it differs from what you found on the internet).

I tried using the given patch, but got the same error.  Looking more closely at the output, I see that the network scripts are actually failing with "cat: /sys/class/net/wlan0/carrier: Invalid argument" when attempting to check if /sys/class/net/wlan0/carrier has the value "1".

There does not appear to be any relevant dmesg output.
Comment 5 Jussi Kivilinna 2011-03-29 20:05:04 UTC
Ok, it is not about endpoint types after all. 

Can you compile zd1211rw with CONFIG_ZD1211RW_DEBUG=y for more dmesg output?
Comment 6 jcallen 2011-03-29 20:37:11 UTC
Created attachment 52572 [details]
dmesg output
Comment 7 Jussi Kivilinna 2011-03-30 08:41:12 UTC
Created attachment 52612 [details]
Remove bogus URB flag and add buffer len check to URB completion handler.

I should have tested with USB debugging enabled, as it turns on more checks on URBs. 

Patch removes the bogus flag introduced by sync->async patch. Old code had buffer len check that new code tried to handle with NO_SHORT flag.
Comment 8 Jussi Kivilinna 2011-04-01 14:26:39 UTC
Did you have chance to test this yet?
Comment 9 Jussi Kivilinna 2011-04-01 16:41:44 UTC
Reproduced and tested fix myself.
Comment 10 jcallen 2011-04-02 22:54:38 UTC
Created attachment 53272 [details]
kernel backtrace

(In reply to comment #7)
> Created an attachment (id=52612) [details]
> Remove bogus URB flag and add buffer len check to URB completion handler.
> 
> I should have tested with USB debugging enabled, as it turns on more checks
> on
> URBs. 
> 
> Patch removes the bogus flag introduced by sync->async patch. Old code had
> buffer len check that new code tried to handle with NO_SHORT flag.

The new patch allows the network to start up properly, however this seems to have exposed another bug: my dmesg buffer immediately fills up with (apparently identical) backtraces as soon as I try to start up networking; I have attached a sample.  I'm not sure if I should open a new bug report for this.
Comment 11 Jussi Kivilinna 2011-04-03 07:51:39 UTC
Created attachment 53302 [details]
Fixes WARNING caused by zd_usb_reset_rx_idle_timer/del_timer_sync
Comment 12 Jussi Kivilinna 2011-04-03 07:53:17 UTC
I ran to same bug/WARNING and fix is going upstream.
Comment 13 Florian Mickler 2011-04-12 09:10:19 UTC
A patch referencing this bug report has been merged in v2.6.39-rc3:
Comment 14 Florian Mickler 2011-04-12 09:18:51 UTC
A patch referencing this bug report has been merged in v2.6.39-rc3:

commit 2fc713b20469b2779fa89f582d2a9696b10031e7
Author: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Date:   Fri Apr 1 19:34:08 2011 +0300

    zd1211rw: remove URB_SHORT_NOT_OK flag in zd_usb_iowrite16v_async()
Comment 15 Florian Mickler 2011-04-12 09:23:50 UTC
The warning fix should be: 

commit 023535732f4db01af4921f20f058bc4561d9add7
Author: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Date:   Fri Apr 1 19:34:16 2011 +0300

    zd1211rw: reset rx idle timer from tasklet