OpenWrt Forum Archive

Topic: ar9331's usb stability issue - [SOLVED]

The content of this topic has been archived between 23 Mar 2017 and 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hello all,

i just want to take a few minutes to sum up the facts... there is a lot of information here and for someone new to this it might be a bit overwhelming.

1. All AR9331 based routers suffer USB 1.1 to USB 2.0 interoperability problems.
2. when purchasing routers from a single vendor some routers fail immediately, some routers work perfectly, some routers work some of the time.  For example, I have 11 alfa AP121U routers here 5 of them fail immediately 5 of them work perfectly and one of them works some of the time.
3. the problem is somehow related to WiFi.  When you disable the WiFi the problem goes away.
4. The problem can be resolved in every single case by using a passive USB 2.0 hub
5. The problem only happens with USB bulk transfers.  Isochronous transfers seem to be OK.
6. the problem is not a power supply issue
7. this is not related to the place of manufacture of the chipset (happens with both korean and taiwan made chips) or version.


did i miss anything?

--luis

(Last edited by lsoltero on 13 Dec 2012, 15:26)

Good summary!

Adding a large capacitor across USB GND/VBUS does not help.

Page 255 of the datasheet talks about USBMode and the Stream Disable Mode. By default the  Stream Disable Mode is inactive.  It appears that if it is made active - then overruns/underruns of the latency FIFO are eliminated for low bandwidth systems.

May be worth trying to set that bit  4 to "1".

Ashok

Squonk wrote:

Be careful, some parts of the datasheet (p 237) which seem to be generic tell about low/full speed hand-off, but in some other parts, it is explicitly told that there is no hand-off (pp 251-252).

It isn't the circuit design: this happens on several models from TP-Link and Alfa (at least...) which only have in common that they are AR9331-based.

From my experience with the TP-Link T-WR703N, the routing is clean with controlled length and impedance traces, no stub, and only ESD protection devices in the middle.

It is not related to the chip revision either, but results may vary largely from one chip to the other.

Also, if you turn off the wireless, you have no longer problems... Same if you insert a passive hub.

It looks like wireless radio interferes with the USB clock PLL in some way, only in full-speed mode...

Any idea?

rickysland wrote:

Hello, I have do some information.
see this:https://dev.openwrt.org/ticket/12385#ticket
Sorry for my poor English.

The main test is: shutdown your wifi($wifi down),useing Physics line connect, the problem gone...

I insert a passive USB hub to test my sound card, and i found it's more terrible then insert it direct. So I don't thing insert  a passive USB hub is a good idea to slove this.
I'm sure my hub is usb 2.0 because it show:usb 1-1: new high-speed USB device number 4 using ehci-platform

rickysland wrote:
rickysland wrote:

Hello, I have do some information.
see this:https://dev.openwrt.org/ticket/12385#ticket
Sorry for my poor English.

The main test is: shutdown your wifi($wifi down),useing Physics line connect, the problem gone...

I insert a passive USB hub to test my sound card, and i found it's more terrible then insert it direct. So I don't thing insert  a passive USB hub is a good idea to slove this.
I'm sure my hub is usb 2.0 because it show:usb 1-1: new high-speed USB device number 4 using ehci-platform

useing sound card is very easy to found the usb problem. The sound chuck.

interesting...

We use a inexpensive full speed USB sound card in our application through a USB 2.0 HUB on Alfa hornet board without issue.   I have tested this on 10 different hornet based routers without issue.   The sound card we used is based on the CMedia 109 chipset.

I can confirm that TL-MR3220v2 is also vulnerable.

I've tried using it with FT232RL, and it works for a while, and then fails.

Normally shielding of USB is connected through 1nF to ground, tried to connect it directly to GND, leave it floating but its not helping.

Are the AR9341 powerd routers also vulnerable (TL-MR3420v2)?

(Last edited by hot-dog on 28 Jan 2013, 00:04)

I may be a little bit pessimistic, but as the thread title suggests it: all AR9331-based routers may be affected, until someone finds a workaround.

I tested on Ralink RT5350-based Hame MPR-A1 routers without any problem using LS/FS/HS USB devices...

(Last edited by Squonk on 28 Jan 2013, 00:18)

A data sheet of the AR9331 was posted on the web and I pulled it down and there
was a section in the datasheet which indicated that if the USB Mode register bit
is enabled then the performance with lower speed USB devices would improve.

I made the change in dev-usb.c found in
trunk/target/linux/ar71xx/files/arch/mips/ar71xx/dev-usb.c
using some of the other fixes therein for other platforms as a template.  Also have to make a small edit to the include file (don't remember which one  - but it is pretty obvious).

Sorry to say that it did not change anything (I did verify that my modified file was being used to build the new firmware)

If I get some time I will look through the datasheet more and try other tweaks. The datasheet is on a Chinese site and a link to it can be found on either this thread or a similar thread in this forum. It would help if others try some tweaks  and see if the problem gets fixed.

I recon , that since all ar9331 are vulnerable, and turning off wi-fi helps, then its an hardware silicon issue.

Can anyone confirme tha ar9341 routers are NOT vulnerable?

hello all,

finally got a response from Atheros on the AR9331 USB 1.1 issue.  I quote

"They don’t want to fix the problem regarding USB1.1 because USB2.0 is the mainstream now. Furthermore, USB3.0 becomes more and more popular. So, the USB Hub will be necessary"


So there you have it.

--luis

looks like there is a market for a really small hub. Even a one-one hub that would just sit in the socket and sort the issue.

For me this issue is somehow relative with power supply, because right now I have a TL-MR3040 and with a passive hub (either 1.1 or 2.0) the router still reset!!! Although when I external power (5v adapter) the hub trought R188 it work´s perfectly with a webcam and USB hard disc, but also with the 1.1 hub connected to 2.0 hub that is connected to the router!

doiga wrote:

For me this issue is somehow relative with power supply, because right now I have a TL-MR3040 and with a passive hub (either 1.1 or 2.0) the router still reset!!! Although when I external power (5v adapter) the hub trought R188 it work´s perfectly with a webcam and USB hard disc, but also with the 1.1 hub connected to 2.0 hub that is connected to the router!

No, I tried with the same power supply and a lot more devices powered through a passive hub without problem, just remove the hub and attach one single FS device and it crashed from within a few minutes up to 1 hour.

I tried to add a large electrolytic capacitor across VUSB, to no avail.

I looked at the voltage on the USB bus using a good scope: not a single glitch.

Tried with a stabilized bench power supply: same problem.

If you turn off WiFi, no more problem.

But the issue is not the router resetting like you: it is just the USB is not working any more.

You may well have a power supply issue if you try to connect too many devices, as a USB host port is only able to deliver 0.5A after negotiation.

I don't know what is R188 on the MR3040, but if it is the overcurrent protection chip bypass resistor, you are playing with fire...

we have qty 55 TL-MR3040 routers here which have been extensively tested...  For our application the routers will fail without the passive 2.0 hub running on either battery or with external power.  So... its not a issue with power.   What is interesting is that some routers fail immediately and some will run for a long time before they fail... but eventually the all fail.  So... it seems to be a thesholding related problem.   You turn the wifi off an every single one of the them work fine.  Note that 1.1 hub will not fix the issue. It has to be a 2.0 hub.

Look in above and you will find a discussion that pretty much eliminates power as the problem.   So there may be power related issues with your application and this router but I don't think they are related to the Atheros 9331 bug that is being discussed in this thread.

Besides Atheros has confirmed that there is a problem with the processors USB 1.1 implementation.

take care.

--luis

>It has to be a 2.0 hub.

For clarification, as Squonk has pointed out, the hub has to be not only 2.0, but "high speed" as reported in dmesg as opposed to "full speed".  I have bought a number of 2.0 hubs off of ebay which were advertised as "high speed", but they were actually "full speed", and still had the problem of serial usb halting.

In a case I'd ran into device with ar9331, can you please confirm, that the problem appears only with usb 1.x devices, but usb 2.0 and 3.0 devices are working fine? I'm not going to use usb 1.1 at all.

Btw. is there some device list with ar9331? Many wiki pages do not mention the SoC, just the CPU, it would be better to avoid them completely. I'd like to obtain wr842, but no SoC mentioned: http://wiki.openwrt.org/toh/tp-link/tl-mr3420

(Last edited by nozombian on 5 Mar 2013, 08:42)

nozombian wrote:

In a case I'd ran into device with ar9331, can you please confirm, that the problem appears only with usb 1.x devices, but usb 2.0 and 3.0 devices are working fine? I'm not going to use usb 1.1 at all.

See lizby's reply above: USB 1.1, 2.0 or 3.0 doesn't tell you at what speed the device is running!

AR9331 USB is not working at low-speed and has problems at full-speed, so USB 1.1 devices will not work reliably, but USB 2.0 or 3.0 may also experience problems if they run at these speeds.

Thank you Squonk for clarification. That makes usb on ar9331 w/o hub pretty useless sad Announcing a list which devices contain this bug would be nice.

(Last edited by nozombian on 5 Mar 2013, 10:53)

Yes, by turning wifi off is one of the solutions!


Facts, at least with my MR3040:

->With a passive hub 2.0 high-speed when I plug it just resets instantly, or during boot with wifi turning ON it resets!

->With a external power hub 1.0/2.0 even with wifi ON it work's perfectly (and for days);

Normal boot with external power hub 2.0 high speed

[    7.630000] SCSI subsystem initialized
[    7.810000] usbcore: registered new interface driver usbfs
[    7.810000] usbcore: registered new interface driver hub
[    7.820000] usbcore: registered new device driver usb
[    8.250000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.260000] ehci-platform: EHCI generic platform driver
[    8.270000] ehci-platform ehci-platform: EHCI Host Controller
[    8.270000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    8.280000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    8.310000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    8.310000] hub 1-0:1.0: USB hub found
[    8.310000] hub 1-0:1.0: 1 port detected
[    8.410000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    8.540000] uhci_hcd: USB Universal Host Controller Interface driver
[    8.560000] Initializing USB Mass Storage driver...
[    8.560000] usbcore: registered new interface driver usb-storage
[    8.570000] USB Mass Storage support registered.
[    8.660000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    8.810000] hub 1-1:1.0: USB hub found
[    8.810000] hub 1-1:1.0: 4 ports detected

BTW what´s your settings for: channel, transmit power, mode, HT mode and country.

(Last edited by doiga on 6 Mar 2013, 16:05)

Hello all,
sorry for interrupting.
I tried several USB-to-serial converters, and mainly used PL2303-based converters.
Just want to confirm:
- Same issue on TL-MR3020, worked for some minutes then it hangs completely
- If WLAN is turned off, all works well
- Powered USB 1.0 hub does not help (so it is not a power issue)
- Unpowered USB 2.0 hub does not help either
- I got it working perfectly on TL-MR3420 (@hot-dog so I think it's not a problem with this model)

I've posted in TL-MR3020 support thread (https://forum.openwrt.org/viewtopic.php … 01#p159101)
I think it is safe to assume that this problem can only sometimes be solved using a hub (which still fails on me)

(Last edited by tuwuhs on 6 Mar 2013, 12:10)

Is the usb2 hub definitely high speed (dmesg should confirm). Lots of "usb2" hubs on ebay are not.

tuwuhs wrote:

...
- If WLAN is turned off, all works well
- Powered USB 1.0 hub does not help (so it is not a power issue)
- Unpowered USB 2.0 hub does not help either
...
I think it is safe to assume that this problem can only sometimes be solved using a hub (which still fails on me)

Agree!
My unpowered (or passive) hub 2.0 HIGH-SPEED didn't solve the problem, makes the router reset! But external powered hub 2.0 HIGH-SPEED works great!
But if isn´t a power issue what else can it be?

(Last edited by doiga on 6 Mar 2013, 16:06)

doiga wrote:
tuwuhs wrote:

...
- If WLAN is turned off, all works well
- Powered USB 1.0 hub does not help (so it is not a power issue)
- Unpowered USB 2.0 hub does not help either
...
I think it is safe to assume that this problem can only sometimes be solved using a hub (which still fails on me)

Agree!
My unpowered (or passive) hub 2.0 HIGH-SPEED didn't solve the problem, makes the router reset! But external powered hub 2.0 HIGH-SPEED works great!
But if isn´t a power issue what else can it be?

It looks like you are hitting a power supply limit, and adding your external powered hub just solved the problem.

What else can it be? It looks like the WiFi radio is generating spurious RF emissions serious enough to unlock the USB clock PLL... It looks like it only affects critically USB full-speed synchronous transmissions causing USB to hang (NOT router reset), while USB full-speed isochronous (i.e. sound or video) may suffer some some bit loss (click/pops in sound stream and stripes in video) and keep on going.

@Squonk the "spurious emissions" theory sounds very reasonable to me. And I've experienced the clicks in sound stream also. Too bad that we have this problem for such a nice router like TL-MR3020.
So... case closed, it is? wink