Bug 12380 - rtl8187 dies when upload
Summary: rtl8187 dies when upload
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 high
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-07 10:06 UTC by Davide Totaro
Modified: 2009-03-26 13:01 UTC (History)
5 users (show)

See Also:
Kernel Version: 2.6.28
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
Patch 1 of 3 (1.30 KB, patch)
2009-01-14 14:13 UTC, Larry Finger
Details | Diff
Patch 2 of 3 (704 bytes, patch)
2009-01-14 14:13 UTC, Larry Finger
Details | Diff
Patch 3 of 3 (1.47 KB, patch)
2009-01-14 14:14 UTC, Larry Finger
Details | Diff
Patch for V2.6.28 and before (518 bytes, patch)
2009-01-22 09:26 UTC, Larry Finger
Details | Diff
Patch for V2.6.29-rcX (581 bytes, patch)
2009-01-22 09:29 UTC, Larry Finger
Details | Diff
Patch for power setting on RTL8187L (617 bytes, patch)
2009-01-25 17:18 UTC, Larry Finger
Details | Diff
Patch for power setting on RTL8187L (1.28 KB, patch)
2009-01-25 19:23 UTC, Larry Finger
Details | Diff

Description Davide Totaro 2009-01-07 10:06:49 UTC
Latest working kernel version: 2.6.26
Earliest failing kernel version: 2.6.27
Distribution: Archlinux
Hardware Environment: Netgear WG111v2

Problem Description:
If the upload rate reaches a threshold ( > 2-3 KB/s) the connection hangs and I can't reconnect. Only after a rrmod/modprobe of rtl8187 I can connect.
I installed also the lastest compat-wireless (updated to gen 7, 2009) but the problem remains.
Comment 1 Larry Finger 2009-01-14 13:06:48 UTC
What are the USB ID's for this device? The output of lsusb will show that info.
Comment 2 Hin-Tak Leung 2009-01-14 13:33:05 UTC
2-3KB/s is quite sad - are you sure about the "Latest working kernel version: 2.6.26" part - did it work better before?
Comment 3 Davide Totaro 2009-01-14 13:39:33 UTC
I used the 2.6.26 for a long time and it worked. The problem appeared after theupgrade to 2.6.27. Also 2.6.28 is affected (compiled by me).
I'll downgrade the kernel in these days to test the behaviour.

$ lsusb | grep WG     
Bus 002 Device 005: ID 0846:6a00 NetGear, Inc. WG111 WiFi (v2)
Comment 4 Larry Finger 2009-01-14 13:46:51 UTC
Ah, your device is an RTL8187, not an RTL8187B. I believe the developers all have RTL8187B's, In a test made since you posted the bug, I ran a Ktorrent test and was uploading 16 KB/s without trouble.

I'll review the differences between the 8187 and 8187B code. If there are patches, could you test them?
Comment 5 Davide Totaro 2009-01-14 14:05:16 UTC
Of course I can do it ;)
Comment 6 Larry Finger 2009-01-14 14:13:02 UTC
Created attachment 19800 [details]
Patch 1 of 3
Comment 7 Larry Finger 2009-01-14 14:13:37 UTC
Created attachment 19801 [details]
Patch 2 of 3
Comment 8 Larry Finger 2009-01-14 14:14:08 UTC
Created attachment 19802 [details]
Patch 3 of 3
Comment 9 Hin-Tak Leung 2009-01-14 16:15:36 UTC
(In reply to comment #8)
> Created an attachment (id=19802) [details]
> Patch 3 of 3
> 

Am a bit worry about the fact that this patch isn't symmetrical (with rtl8187b)?

On the rtl8187b, I regularly do uploads (to sourceforge) and 20-40kB/s is quite normal and limited by my upstream bandwidth. 2-3kB/s is quite sad.  
Comment 10 Larry Finger 2009-01-14 16:57:08 UTC
As Herton noted, that patch may not be correct; however, without it there is no reporting back of the TX count. The asymmetry is due to a status endpoint in the 8187B that is probably not present in the 8187.

Using tcpperf, I can push 3.2 Mb/s through my RTL8187B to another host on my LAN.
Comment 11 Larry Finger 2009-01-15 10:37:33 UTC
Davide,

Patch 3 is no good. Ignore it.

What does your device show with the command?

lsusb -v -d0846:6a00

Thanks,
Comment 12 Davide Totaro 2009-01-15 12:45:31 UTC
[dvd@abulafia ~]$ sudo lsusb -v -d0846:6a00

Bus 002 Device 005: ID 0846:6a00 NetGear, Inc. WG111 WiFi (v2)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0846 NetGear, Inc.
  idProduct          0x6a00 WG111 WiFi (v2)
  bcdDevice            1.00
  iManufacturer           1 NETGEAR WG111v2
  iProduct                2 NETGEAR WG111v2
  iSerial                 3 001B2F91F8F1
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 Wireless Network Card
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         0 (Defined at Interface level)
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              5 Bulk-IN,Bulk-OUT,Bulk-OUT
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)



This is the output. (OT: have I to report the outputs as attachments or is ok like this?)
Ok, I'm going to apply patch 1 and 2 to a vanilla 2.6.28. 
Comment 13 Larry Finger 2009-01-15 13:16:02 UTC
Inline like this is fine. I attached the patches because you would need them as files.
Comment 14 Davide Totaro 2009-01-15 18:08:42 UTC
Ok, I git-clone from wireless-testing, applied both patches and I compiled.
Now upload works but it's capped to ~100KB/s (ftp in a LAN).
Browsing is very variable: sometimes sloooow, sometimes ok.
Opening emesene or amule causes the hang and needs a rmmod/modprobe!!
Comment 15 Larry Finger 2009-01-16 06:45:54 UTC
If possible, I would like you to back the patches back out one at a time to see if either, or both helped your upload, or if it was something else in wireless-testing.
Comment 16 Hin-Tak Leung 2009-01-16 08:05:26 UTC
Argh, there is no need to git-clone the whole wireless-testing kernel - if your (possibly vendor) kernel and headers are in place, and most bits are as kernel modules, it is a bit quicker for trying out new changes with compat-wireless, which can swap modules with newer versions a bit quicker.

Now you have git-clone'ed wireless-testing, you might as well keep it and use it to update compat-wireless...
Comment 17 Hin-Tak Leung 2009-01-16 08:15:41 UTC
Just looked a the lsusb in detail - it only has 3 endpoints and quite different from 8187b. (in the back of my head I knew this as one of the main differences, but seeing it feels different...) 
Comment 18 Larry Finger 2009-01-16 08:47:06 UTC
In addition, the current driver only uses 1 of the OUT endpoints. The vendor driver distinguishes them with ep 2 for low- and ep 3 for normal-priority transmits.

I have a patch to put the management frames on ep2 and other frames on ep3, but will wait until I get a chance to test here. I bought a Netgear WG111v2 on E-bay yesterday. I should have it within a week.
Comment 19 Davide Totaro 2009-01-16 11:43:54 UTC
I used the git because the patch was for the wireless-testing folder and it isn't present in the compat-wireless package. Sorry for the mistake but I don't knew where to apply the patch. 

I'll try the patch one at a time this evening if it's possible (It's 9 pm here!).
Comment 20 Larry Finger 2009-01-16 12:14:28 UTC
It was not a mistake. What Hin-Tak was saying is that you could have just downloaded compat-wireless. Any patch for wireless-testing will also apply to that code.

On the other hand, he just asked about a "bug" that turned out to be an incompatibility with his underlying kernel. Now that you have the git tree, it is trivial to keep up with wireless-testing.
Comment 21 Hin-Tak Leung 2009-01-16 13:51:04 UTC
Probably confused by campat-wireless git repository vs compat-wireless tar balls. compat-wireless git repository contains a bunch of scripts and some patches which massages wireless-testing into a form suitable for building against released kernel headers - the massaged result is snapshott'ed daily into tar balls.

i.e. you can apply the patch against the daily snapshot compat-wireless tar balls; or since you already have wireless-testing git and compat-wireless git,
you can generate the snapshot by running inside compat-wireless git,
  export GIT_TREE=/where/wireless-testing-git-is
  ./script/admin-refresh.sh
then apply patches to the resulting directory.
Comment 22 Davide Totaro 2009-01-21 13:24:41 UTC
I'm sorry, but at this time I'm VERY busy and I can't do any test..
This may be the same bug: http://bbs.archlinux.org/viewtopic.php?id=63274
Comment 23 Hin-Tak Leung 2009-01-21 15:43:56 UTC
(In reply to comment #22)
> I'm sorry, but at this time I'm VERY busy and I can't do any test..
> This may be the same bug: http://bbs.archlinux.org/viewtopic.php?id=63274

That report is unrelated - it is about the Realtek gigabit (wired) ethernet driver, not any of the wireless drivers.

If you can find the time to try things out eventually and report back it would be good.
Comment 24 Larry Finger 2009-01-22 09:26:44 UTC
Created attachment 19939 [details]
Patch for V2.6.28 and before

This patch, which is for kernels 2.6.28 and before, adds a short packet following transmission of the data packet. It helped my RTL8187 device. The problem showed up when doing a git pull on a tree located on an NFS volume.
Comment 25 Larry Finger 2009-01-22 09:29:09 UTC
Created attachment 19940 [details]
Patch for V2.6.29-rcX

This patch, which is for 2.6.29-rcX, adds a short packet after the data transaction.
Comment 26 Jon Nettleton 2009-01-24 15:41:08 UTC
I am just finally getting around to debugging my RTL8187B from a Il1 netbook.  It has the same problem exhibited above.  The most recent snapshot compat-wireles-1-24 does seem to be helping a lot with reliability.  I am definitely seeing problems with rate control, and there seems to be problems with small packets transfers like UDP dns lookups.

I can get you any information that will help in debugging.  Just ask.
Comment 27 Larry Finger 2009-01-25 17:18:21 UTC
Created attachment 19988 [details]
Patch for power setting on RTL8187L

Please try this patch on top of current wireless-testing.

Larry
Comment 28 Larry Finger 2009-01-25 19:23:14 UTC
Created attachment 19991 [details]
Patch for power setting on RTL8187L

The original version of this patch will work for the Netgear WG111V2, but would not help all versions of the RTL8187B. The new one will help will all units.
Comment 29 Jon Nettleton 2009-01-26 00:58:24 UTC
This definitely has my rlt8187b running the best it has been.  Been connected for a couple of hours now without dropouts.  The range of the chipset is still a bit limited but that may just be the hardware.  

Thanks
Comment 30 Alan 2009-03-26 13:01:55 UTC
commit eb83bbf57429ab80f49b413e3e44d3b19c3fdc5a

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