Repository navigation
Description
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
Activity
rodizio1 commentedon May 21, 2017
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:
#1763
qca/open-ath9k-htc-firmware#114
P33M commentedon May 30, 2017
@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?
pi-resource commentedon May 31, 2017
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
Hope that helps.
Cheers,
Dusty
www.pi-resource.com
rodizio1 commentedon Jun 1, 2017
@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:
https://www.aliexpress.com/item/Azurewave-AW-NU138-150M-Wifi-802-11BGN-USB-High-Gain-Atheros-AR9271-150Mbps-Wireless-Mini-150M/32797793917.html
P33M commentedon Jun 12, 2017
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.
P33M commentedon Jun 12, 2017
I have a naive fix that seems to make things better for me - in
dwc_otg_hcd_queue.c:qh_init(), by munging the qh->interval for Interrupt endpoints to be a minimum of 2 (i.e. 2 microframes), all 4 devices appear to be working. I can scan APs on all 4 wireless devices and have 2 of them associated to our local wireless network.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.
popcornmix commentedon Jun 13, 2017
Latest rpi-update kernel includes the int_ep_interval_min kernel config option.
P33M commentedon Jun 13, 2017
@pi-resource @rodizio1 on a rpi-updated Pi, can you add
dwc_otg.int_ep_interval_min=2to/boot/cmdline.txtand reboot, then try using up to 4 Atheros wifi devices? Note that eventually with more than 4 devices you will run up against the limitation described in #2050 as a bulk IN endpoint is used for RX data, so on quiet networks endpoint servicing latency will increase.rodizio1 commentedon Jun 18, 2017
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.
rodizio1 commentedon Jun 18, 2017
shortly after I see this in dmesg:
The system seems to be still working normally though.
P33M commentedon Jun 20, 2017
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?
popcornmix commentedon Jun 20, 2017
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.
pi-resource commentedon Jun 23, 2017
@P33M - Sorry for the delay, but work unfortunately gets in the way sometimes ;)
Unfortunately this hasn't resolved the issue. I note that Jessie 4.9 has been released and it is with that version I just tested. I tried with and without your change to cmdline.txt and it made no difference. Two 'Atheros AR9271' work fine, but as soon as a third is connected, although it is seen by 'lsusb', there are errors in dmesg. Currently I'm booting the Pi (v3), then plugging in each WiFi adapter leaving about 15 seconds between each so that they have time to initialise. Note I am using a good quality powered USB hub to ensure no power issued. I've tried without the hub and get exactly the same results.
Without modifying 'cmdline.txt':
With the modified 'cmdline.txt':
Thanks!
popcornmix commentedon Jun 23, 2017
This predates this whole discussion so won't support int_ep_interval_min.
You'll need to use rpi-update kernel for testing until this reaches a stable image.
pi-resource commentedon Jun 23, 2017
D'oh
I was rushing. Having now updated the kernel, I can confirm that I have 4 'Atheros AR9271' adapters working without issue.
Well done!
melyux commentedon Apr 23, 2018
I never thought I'd live to see this problem solved. Thanks everyone.
JamesH65 commentedon Apr 23, 2018
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?
melyux commentedon May 15, 2018
I'm still getting kernel messages like this including ath9k_htc, but still seems to be working: