-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use more than 2 'Atheros AR9271' WiFi Dongles #2023
Comments
Yes, more than two Atheros USB sticks give problems on the Pi. You may get three to work if you make sure that nothing else is accessing the USB bus (ethernet for example ...) while the Atheros sticks are being initialized and iwconfig/ifconfig commands are being run. Also make sure to not run iwconfig/ifconfig commands "too fast", configure one adapter after another with a little delay in-between. Four or more adapters never work though. See here for more info: |
@rodizio1 From an examination of seller comments on Amazon, it looks like there is a v2 of the WN-722N that doesn't use the Atheros chipset. Do you have a guaranteed source for the v1.x devices? |
Hi P33M. I simply crossed my fingers and hoped for the best and I received v1.10 which works fine. I purchased from a UK seller, Skydigital https://www.amazon.co.uk/s?merchant=A3FPBXRLKM9OSB |
@P33M Sorry, don't know any sure sources for the WN-722N V1.x Alfa AWUS036NHA would be a sure bet. It has the UART of the AR9271 on solder pads, could become handy for debugging I guess. Expensive though. Another option would be searching for "AR9271" on AliExpress, for example such a dongle for 5 bucks: |
I have acquired 4 wifi adapters using this chipset. I see the same behaviour, but with 3 devices plugged in and not 4. When I plug the 4th device in, I get nothing in dmesg and the device is not detected. Eventually ntpd times out and I get hung task callbacks in the kernel message log. If I remove device 3, suddenly device 4 shows up:
The clue I think is the interrupt endpoint descriptors. I see my host channel mask pegged at 0x7f meaning 7 of 8 channels are used, which is the limit for either periodic or non-periodic transfers.
The two interrupt endpoints have an interval of 1 microframe. Periodic transfers happen in the microframe after they were queued to the hardware, so the host channel is allocated but idle for 125uS until it transmits the interrupt token. From a cursory examination of host channel masks with 1 device + ethernet active, it looks like two host channels are semi-permanently idle per device added - which would follow for a bulk endpoint + interval-1 interrupt endpoint being active. This explains why things break with 3 devices - 6 + 1 = 7 active host channels, plus intermittent hub status and Ethernet interrupt/control endpoint polling (+2 host channels). At least one endpoint is going to get starved if the hardware ends up in a suboptimal scheduling state. |
I have a naive fix that seems to make things better for me - in This does of course mean that the Interrupt endpoint gets serviced only half as regularly as it is requesting, but this is 250uS vs 125uS. I doubt there would be much real-world effect, but this makes me think that this needs to be an explicitly enabled module parameter rather than a blanket constraint. |
Latest rpi-update kernel includes the int_ep_interval_min kernel config option. |
@pi-resource @rodizio1 on a rpi-updated Pi, can you add |
Thanks a lot @P33M. Back-ported the change in #2067 to the kernel 4.4.11 I'm using. (There are delays in the order of several milliseconds sometimes when one card receives many packets per second and others only a few. This is worse with newer kernels, that's why I stick with this one at the moment). Just did a quick test, so far it seems to be working. Need to do more testing though.
|
shortly after I see this in dmesg:
The system seems to be still working normally though. |
Regarding the millisecond latencies with 4.9 - this is not an isolated issue, Libreelec DVB-T users have reported "worse" latency in the transition from 4.8-4.9. The warning has an existing issue open: #1808 @pi-resource have you re-tested with latest rpi-update kernel? If so, does it work for you? |
Actually we are still bisecting but the 4.8-4.9 regression has been narrowed down to:
That is still a merge of hundreds of commits, but it looks like an upstream issue (that also affects x86) rather than a dwc_otg issue. Thread here. |
@P33M - Sorry for the delay, but work unfortunately gets in the way sometimes ;) Without modifying 'cmdline.txt':
With the modified 'cmdline.txt':
Thanks! |
This predates this whole discussion so won't support int_ep_interval_min. |
D'oh |
I never thought I'd live to see this problem solved. Thanks everyone. |
I suspect this is an upstream driver fix - there does seem to be quite a bit of churn on the atheros drivers. Can this issue now be closed? |
I'm still getting kernel messages like this including ath9k_htc, but still seems to be working:
|
More than two WiFi Dongel with the Atheros AR9271 chipsets are not identified. In this example I used a TP-LINK TL-WN722N. I can confirm there were NO power issues. See dmesg outputs below.
First device plugged in: (all normal)
[ 3626.648706] usb 1-1.2.1: new high-speed USB device number 6 using dwc_otg
[ 3626.799647] usb 1-1.2.1: New USB device found, idVendor=0cf3, idProduct=9271
[ 3626.799661] usb 1-1.2.1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 3626.799669] usb 1-1.2.1: Product: USB2.0 WLAN
[ 3626.799677] usb 1-1.2.1: Manufacturer: ATHEROS
[ 3626.799684] usb 1-1.2.1: SerialNumber: 12345
[ 3627.944779] usb 1-1.2.1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[ 3627.944907] usb 1-1.2.1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[ 3627.944922] usb 1-1.2.1: ath9k_htc: Firmware htc_9271.fw requested
[ 3627.945481] usbcore: registered new interface driver ath9k_htc
[ 3628.241745] usb 1-1.2.1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272
[ 3628.487600] ath9k_htc 1-1.2.1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 3633.007736] ath9k_htc 1-1.2.1:1.0: ath9k_htc: FW Version: 1.3
[ 3633.007748] ath9k_htc 1-1.2.1:1.0: FW RMW support: Off
[ 3633.007755] ath: EEPROM regdomain: 0x809c
[ 3633.007759] ath: EEPROM indicates we should expect a country code
[ 3633.007764] ath: doing EEPROM country->regdmn map search
[ 3633.007769] ath: country maps to regdmn code: 0x52
[ 3633.007775] ath: Country alpha2 being used: CN
[ 3633.007779] ath: Regpair used: 0x52
[ 3633.034162] ieee80211 phy1: Atheros AR9271 Rev:1
[ 3633.899923] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
Second device plugged in: (Normal)
[ 3678.808836] usb 1-1.2.2: new high-speed USB device number 7 using dwc_otg
[ 3678.959885] usb 1-1.2.2: New USB device found, idVendor=0cf3, idProduct=9271
[ 3678.959899] usb 1-1.2.2: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 3678.959907] usb 1-1.2.2: Product: USB2.0 WLAN
[ 3678.959915] usb 1-1.2.2: Manufacturer: ATHEROS
[ 3678.959940] usb 1-1.2.2: SerialNumber: 12345
[ 3678.961096] usb 1-1.2.2: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[ 3678.962086] usb 1-1.2.2: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[ 3678.962102] usb 1-1.2.2: ath9k_htc: Firmware htc_9271.fw requested
[ 3679.255303] usb 1-1.2.2: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272
[ 3679.500607] ath9k_htc 1-1.2.2:1.0: ath9k_htc: HTC initialized with 33 credits
[ 3682.993741] ath9k_htc 1-1.2.2:1.0: ath9k_htc: FW Version: 1.3
[ 3682.993753] ath9k_htc 1-1.2.2:1.0: FW RMW support: Off
[ 3682.993760] ath: EEPROM regdomain: 0x809c
[ 3682.993765] ath: EEPROM indicates we should expect a country code
[ 3682.993769] ath: doing EEPROM country->regdmn map search
[ 3682.993775] ath: country maps to regdmn code: 0x52
[ 3682.993780] ath: Country alpha2 being used: CN
[ 3682.993784] ath: Regpair used: 0x52
[ 3683.005653] ieee80211 phy2: Atheros AR9271 Rev:1
[ 3683.869106] IPv6: ADDRCONF(NETDEV_UP): wlan2: link is not ready
Third and subsequent devices: (ERRORS)
[ 3826.729283] usb 1-1.2.4.1: new high-speed USB device number 8 using dwc_otg
[ 3826.880406] usb 1-1.2.4.1: New USB device found, idVendor=0cf3, idProduct=9271
[ 3826.880420] usb 1-1.2.4.1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 3826.880453] usb 1-1.2.4.1: Product: USB2.0 WLAN
[ 3826.880461] usb 1-1.2.4.1: Manufacturer: ATHEROS
[ 3826.880469] usb 1-1.2.4.1: SerialNumber: 12345
[ 3826.881665] usb 1-1.2.4.1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[ 3826.883288] usb 1-1.2.4.1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[ 3826.883344] usb 1-1.2.4.1: ath9k_htc: Firmware htc_9271.fw requested
[ 3827.176355] usb 1-1.2.4.1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272
[ 3828.429300] usb 1-1.2.4.1: Service connection timeout for: 256
[ 3828.429347] ath9k_htc 1-1.2.4.1:1.0: ath9k_htc: Unable to initialize HTC services
[ 3828.429374] ath9k_htc: Failed to initialize the device
[ 3828.431265] usb 1-1.2.4.1: ath9k_htc: USB layer deinitialized
all devices are shown with the 'lsusb' command
The text was updated successfully, but these errors were encountered: