Bug 42815 - r8712u with RTL8191S WLAN Adapter: Connection lasts but no traffic for several seconds
Summary: r8712u with RTL8191S WLAN Adapter: Connection lasts but no traffic for severa...
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Larry Finger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-23 20:18 UTC by Adrian Batzill
Modified: 2012-04-04 15:01 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.2.5
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Patch to allow vendor driver v2.6.6.0.20110401 to compile and run (25.29 KB, patch)
2012-02-23 23:38 UTC, Larry Finger
Details | Diff
dmesg photo (265.96 KB, image/jpeg)
2012-02-24 08:40 UTC, Adrian Batzill
Details
Patch to fix locking problem when using wicd (570 bytes, patch)
2012-02-24 17:06 UTC, Larry Finger
Details | Diff
Patch to fix formware load when using wicd (1.62 KB, patch)
2012-02-24 17:10 UTC, Larry Finger
Details | Diff

Description Adrian Batzill 2012-02-23 20:18:56 UTC
Hello,

I have this Wifi USB Adapter from Digitus with a realtek chip:
Bus 002 Device 006: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191S WLAN Adapter

It's basically working on my Ubuntu box with a custom kernel 3.2.5.
However, every few minutes (I'd say every 2-5 minutes), the connection speed drops to 0kb/s.
So basically, I am still connected to the access point, but there is no data going through the network (no ping, no web page loading, etc).
Several seconds later (usually about 10-30 seconds), everything is back to normal.

I'm not sure if it's related to the problem, but there are several messages like this in dmesg:
[38017.423303] r8712u: [r8712_got_addbareq_event_callback] mac = 7c:4f:b5:xx:xx:xx, seq = 35744, tid = 0
[39099.504553] r8712u: [r8712_got_addbareq_event_callback] mac = 7c:4f:b5:xx:xx:xx, seq = 32, tid = 0
[42088.211260] r8712u: [r8712_got_addbareq_event_callback] mac = 7c:4f:b5:xx:xx:xx, seq = 46944, tid = 0
[43687.872683] r8712u: [r8712_got_addbareq_event_callback] mac = 7c:4f:b5:xx:xx:xx, seq = 43328, tid = 0
[45528.835405] r8712u: [r8712_got_addbareq_event_callback] mac = 7c:4f:b5:xx:xx:xx, seq = 16, tid = 4

However, the connection drops a lot more often than these messages are being displayed.

Also, I'm not sure if this is true, but If i let terminal in the background that constantly pings my router, the connection seems to be more stable.
I'm not sure about this yet, but will keep an eye on it.
=> Could this be related to some kind of powermanagement? i.e. the Wifi-chip is sent to some kind of sleep mode?
Also: I could not find a newer firmware for this driver on the net. So right now I'm using the default firmware shipped with Ubungu 11.10.

Please tell me if you need more information. I have no problem doing some C programming if it's required for debugging. But I am not experienced in driver or kernel development.
Comment 1 John W. Linville 2012-02-23 20:29:34 UTC
Not sure if Larry is interested in this or not -- let's ask... :-)
Comment 2 Adrian Batzill 2012-02-23 21:16:07 UTC
Okay, I guess I was wrong on the Ping-thing.
It just blocked again while the ping was running.

I also tried to compile the driver from the realtek website directly (I only found a driver for RTL8191SU there, while lsusb says RTL8191S. But I think that's the same then...)
However, that driver doesn't even compile and throws a lot of errors like
event_tasklet and xmit_tasklet having an uncomplete type and a failing include to "linux/smp_lock.h". Maybe not compatible with recent Linux kernels(?).
Comment 3 Larry Finger 2012-02-23 22:04:50 UTC
The driver on the Realtek Web site is not compatible with later kernels. If you want to try it, please post the version you downloaded, and the kernel you wish to use. I'll post the corresponding patch. The vendor driver uses features removed from the kernel, and most do not work with 64-bit systems.

I have two different units with RTL8191SU chips, and neither shows this problem.
Comment 4 Adrian Batzill 2012-02-23 22:53:36 UTC
Hey,
1: Can you confirm that my adapter is actually the same as the SU version?
2: Version 2.6.6.0.20110401 with kernel 3.2.5
3: Well, I would only try the realtek driver if it would help locating the probelm.
Do you think it's even worth debugging this? If not, i will just give it back to the vendor as it doesn't work as advertised and go back to my old ralink adaptor (and write a bug report for that one as it only works correctly with patched vendor drivers and is buggy in the kernel, too).
Comment 5 Larry Finger 2012-02-23 23:38:34 UTC
Created attachment 72471 [details]
Patch to allow vendor driver v2.6.6.0.20110401 to compile and run

Whether you want to use this patch is up to you. Your USB ID matches one the two different units that I have. As far as I know, all the chips with the same ID are the same.

Testing with the vendor driver would have some value for me. As I cannot duplicate your result, it would be useful to know if this is something that Realtek fixed. The kernel driver (kernel V3.2 and later) is based on the 8/31/10 version. I have not looked into what is different between 8/31/10 and 4/1/11 versions.
Comment 6 Larry Finger 2012-02-23 23:41:07 UTC
One other question - what is the Digitus model number?
Comment 7 Adrian Batzill 2012-02-23 23:57:34 UTC
It's this little guy: http://www.digitus.info/en/products/network/300mbps-wireless-lan-series/wireless-300n-usb-adapter-dn-7053-2/

I will try the realtek driver tomorrow and report back.
I will also do some tests on Windows to make sure it's not a hardware issue.
Comment 8 Adrian Batzill 2012-02-24 08:32:13 UTC
Oh well, that diddn't quite work out :/

When I loaded the driver and looked at network manager, it found several networks, but all of them were displayed with a very low signal strength (0%?).
When trying to connect, the driver crashed and the kernel hung up (had to SysRq to get out).

Managed to get a dmesg right before the complete hangup.
Comment 9 Adrian Batzill 2012-02-24 08:40:02 UTC
Created attachment 72477 [details]
dmesg photo

File was cleared during reboot. Photograph only :/
Comment 10 Larry Finger 2012-02-24 17:04:12 UTC
I think this was with the vendor driver. Is that correct? If so, I'm not that interested in fixing it.

This morning, I found a bug that would affect kernel 3.2.5. A work-around will be posted.
Comment 11 Larry Finger 2012-02-24 17:06:57 UTC
Created attachment 72478 [details]
Patch to fix locking problem when using wicd

The problem does not appear to affect NetworkManager, but it fails with wicd. This patch is needed for 3.2.0 and later.
Comment 12 Larry Finger 2012-02-24 17:10:00 UTC
Created attachment 72479 [details]
Patch to fix formware load when using wicd

This patch also fixes a problem that fails regularly with wicd and only infrequently with NetworkManager. It applies to kernel 3.2.6 and 3.3-rc4 and later.
Comment 13 Adrian Batzill 2012-02-24 17:13:58 UTC
Hey,
The Crash only exists in the vendor driver. So don't mind fixing it, I'm not interested in using that driver anyway (it was just for testing).

I will update to kernel version 3.2.7 now and apply your patches and see what happens.
Comment 14 Adrian Batzill 2012-02-24 20:33:27 UTC
The new kernel with both of your patches is now running for approx. two hour and I had no problem for now (at least I couldn't see one). I hope that fixed it :)

I'm now on 3.2.7 with both of your patches. I had to include the shorter one by myself as it conflicted with your other file (both do something at around the same line in the source).

What also changed, is that I'm now getting a _lot_ more of the message from my first post in dmesg (sometimes 5 per minute, sometimes none for 5 minutes but a lot more on average).


I will write again if the problem comes back.

btw: I noticed that this driver is in staging for a long time already. Will this ever be moved to stable? Or will there be a replacement some day? Or will it just reside in staging until the devices are outdated enough so nobody uses them any more? Just curious...
Comment 15 Larry Finger 2012-02-24 22:48:06 UTC
The driver is generally as stable as many drivers in the drivers/net/wireless tree, but is still in staging because it does not use mac80211. Doing that rewrite is on my TODO list, but with low priority.

Is it OK if I add a Tested-by line for you in the official patch?
Comment 16 Adrian Batzill 2012-02-24 23:08:03 UTC
Sure.
Tested-by: Adrian Batzill <agib@gmx.de>
Comment 17 Florian Mickler 2012-04-04 15:01:46 UTC
A patch referencing this bug report has been merged in Linux v3.4-rc1:

commit 9f4bc8cf3fe750ed093856a5f5d41c11cc12ad22
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Sat Feb 25 18:10:20 2012 -0600

    staging: r8712u: Fix regression introduced by commit a5ee652

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