qca / open-ath9k-htc-firmware

The firmware for QCA AR7010/AR9271 802.11n USB NICs
Other
429 stars 182 forks source link

ath: phy82: Failed to wakeup in 500us #72

Open yipperr opened 9 years ago

yipperr commented 9 years ago

hello i am using a alpha awus036nha in ubuntu with 3.18 kernel causes a lot of disconnects where the whole driver reloads itself and the usb layer is deinitialized

here is the dmesg

[134330.226799] ath: phy82: Failed to wakeup in 500us [134330.337247] ath: phy82: Failed to wakeup in 500us [134330.553857] cfg80211: Calling CRDA to update world regulatory domain [134330.557245] cfg80211: World regulatory domain updated: [134330.557249] cfg80211: DFS Master region: unset [134330.557250] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [134330.557252] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [134330.557254] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [134330.557255] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A) [134330.557256] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [134330.557257] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [134330.621383] usb 1-1: ath9k_htc: USB layer deinitialized [134330.861057] usb 1-1: new high-speed USB device number 87 using xhci_hcd [134331.008352] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271 [134331.008363] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48 [134331.008369] usb 1-1: Product: UB91C [134331.008373] usb 1-1: Manufacturer: ATHEROS [134331.008377] usb 1-1: SerialNumber: 12345 [134331.010014] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested [134331.472999] usb 1-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272 [134331.708841] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits [134331.938832] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3 [134331.938843] ath: EEPROM regdomain: 0x833a [134331.938846] ath: EEPROM indicates we should expect a country code [134331.938851] ath: doing EEPROM country->regdmn map search [134331.938855] ath: country maps to regdmn code: 0x37 [134331.938859] ath: Country alpha2 being used: GB [134331.938861] ath: Regpair used: 0x37 [134331.943193] ieee80211 phy83: Atheros AR9271 Rev:1 [134331.943229] cfg80211: Calling CRDA for country: GB

added notes tried on usb 2.0 and 3.0 ports its not the usb layer but the driver itself just so to rule out hardware the alpha nha works solid in windows while connecting to wifis

olerem commented 9 years ago

please try latest firmware https://github.com/olerem/ath9k-htc-firmware-blob

Beside, i have similar adapter. What is your reproduction case? How do you know that windows driver runs solid, do you have access to the logs provided by this driver? :)

yipperr commented 9 years ago

i am running the latest wireless backports and the latest firmware blob also i compiled my own it still acts the same way .

this is the log that happens when the usb device disconnects

[140606.192122] usb 1-1: USB disconnect, device number 92 [140606.199477] wlan2: deauthenticating from xx:xx:xx:xx:xx:xx by local choice (Reason: 3=DEAUTH_LEAVING) [140606.212695] ath: phy87: Failed to wakeup in 500us [140606.323103] ath: phy87: Failed to wakeup in 500us [140606.539652] cfg80211: Calling CRDA to update world regulatory domain [140606.542714] cfg80211: World regulatory domain updated: [140606.542718] cfg80211: DFS Master region: unset [140606.542719] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [140606.542722] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [140606.542725] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [140606.542727] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A) [140606.542729] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [140606.542731] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [140606.607097] usb 1-1: ath9k_htc: USB layer deinitialized [140609.679702] usb 1-1: new high-speed USB device number 93 using xhci_hcd [140609.827356] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271 [140609.827366] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48 [140609.827371] usb 1-1: Product: UB91C [140609.827375] usb 1-1: Manufacturer: ATHEROS [140609.827408] usb 1-1: SerialNumber: 12345 [140609.828960] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested [140610.291181] usb 1-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51008 [140610.541389] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits [140610.769990] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.4 [140610.770001] ath: EEPROM regdomain: 0x833a [140610.770004] ath: EEPROM indicates we should expect a country code [140610.770009] ath: doing EEPROM country->regdmn map search [140610.770012] ath: country maps to regdmn code: 0x37 [140610.770024] ath: Country alpha2 being used: GB [140610.770026] ath: Regpair used: 0x37 [140610.773858] ieee80211 phy88: Atheros AR9271 Rev:1 [140610.773877] cfg80211: Calling CRDA for country: GB [140610.779323] cfg80211: Regulatory domain changed to country: GB [140610.779332] cfg80211: DFS Master region: unset [140610.779335] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [140610.779342] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [140610.779347] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [140610.779351] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm), (0 s) [140610.779355] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm), (0 s) [140610.779359] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) [140610.880506] ath9k_htc 1-1:1.0 wlan2: renamed from wlan1 [140610.918467] systemd-udevd[32722]: renamed network interface wlan1 to wlan2 [140611.135072] IPv6: ADDRCONF(NETDEV_UP): wlan2: link is not ready [140612.758780] IPv6: ADDRCONF(NETDEV_UP): wlan2: link is not ready

i know windows driver runs solid because the alpha awus03nha works fine without any disconnecting in windows i said this to rule out this as a hardware issue

to reproduce you pass a lot of traffic (by lot i mean the maximum of my isp) 2mbit which is hardly anything and it disconnects and then reconnects and keeps on doing this with a varied randomness sometimes it wont disconnect for a long while but rest assured it will the timing is very random

i know the ath9k_htc is a firmware for the 144mhz xtensa soc inside the device so why is ath9k driver needed are they both required ? is the ath9k driver causing the problem ?

i have seen the same error ath: phy87: Failed to wakeup in 500us reported in the ath9k driver for other pcie wlan cards in the forums so this might be a ath9k issue ?

what is the role of that ath9k and ath9k_htc play to work this usb adapter ? sorry if this is a stupid question

thanks for your reply

olerem commented 9 years ago

Uff... lots of questions :), lets do it step by step:

Lets try to reduce Interrupt traffic. Seems like it is causing some problems on different HW. Try this: sudo bash -c "echo none > /sys/class/leds/ath9k_htc-phy*/trigger" This command will disable LED blinking.

yipperr commented 9 years ago

by disabling the leds of the wifi card to reduce the interrupt traffic over the usb as you suggested i still get the ath: phy87: Failed to wakeup in 500us

[140606.192122] usb 1-1: USB disconnect, device number 92 [140606.199477] wlan2: deauthenticating from xx:xx:xx:xx:xx:xx by local choice (Reason: 3=DEAUTH_LEAVING) [140606.212695] ath: phy87: Failed to wakeup in 500us [140606.323103] ath: phy87: Failed to wakeup in 500us

followed by the driver reloading itself

[140606.607097] usb 1-1: ath9k_htc: USB layer deinitialized [140609.679702] usb 1-1: new high-speed USB device number 93 using xhci_hcd [140609.827356] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271 [140609.827366] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48 [140609.827371] usb 1-1: Product: UB91C [140609.827375] usb 1-1: Manufacturer: ATHEROS [140609.827408] usb 1-1: SerialNumber: 12345 [140609.828960] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested [140610.291181] usb 1-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51008 [140610.541389] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits [140610.769990] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.4 [140610.770001] ath: EEPROM regdomain: 0x833a [140610.770004] ath: EEPROM indicates we should expect a country code [140610.770009] ath: doing EEPROM country->regdmn map search [140610.770012] ath: country maps to regdmn code: 0x37 [140610.770024] ath: Country alpha2 being used: GB [140610.770026] ath: Regpair used: 0x37 [140610.773858] ieee80211 phy88: Atheros AR9271 Rev:1 [140610.773877] cfg80211: Calling CRDA for country: GB [140610.779323] cfg80211: Regulatory domain changed to country: GB [140610.779332] cfg80211: DFS Master region: unset [140610.779335] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [140610.779342] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [140610.779347] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [140610.779351] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm), (0 s) [140610.779355] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm), (0 s) [140610.779359] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) [140610.880506] ath9k_htc 1-1:1.0 wlan2: renamed from wlan1

yipperr commented 9 years ago

can u specify the particular kernel log your interested the system dmesg log is really huge its been running for some time and the log have accumulated a lot i have already pasted everything that has to concern with the ath9k_htc driver

the system is running ubuntu 14.10 with kernel 3.18.5-031805-generic i tiried the adapter on fedora and had the same results...

searching this error in google ath: phy87: Failed to wakeup in 500us

reveals many pci atheros cards that run the ath9k driver has the same issue so we rule out that this specific to ath9k_htc

yipperr commented 9 years ago

@olerem Failed to wakeup" message comes after usb was disconnected. In this case it is expected message

the same message appears for pcie cards on the pci bus as far as i know pcie cannot be disconnected from the pci bus or removed they dont provide plug and play so this is not simple as the device getting unrecognized ?

but in my case the kernel prints a usb-disconnect which leads to failed wakeups but the drivers usb layer is only deinitialized way later on

[181215.433983] usb 1-1: USB disconnect, device number 108 [181215.442476] wlan2: deauthenticating from xx:xx:xx:xx:xx:xx by local choice (Reason: 3=DEAUTH_LEAVING) [181215.655114] ath: phy103: Failed to wakeup in 500us [181215.670655] cfg80211: Calling CRDA to update world regulatory domain [181215.675054] cfg80211: World regulatory domain updated: [181215.675059] cfg80211: DFS Master region: unset [181215.675061] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [181215.675064] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [181215.675066] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [181215.675068] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A) [181215.675070] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [181215.675071] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A) [181215.734249] usb 1-1: ath9k_htc: USB layer deinitialized [181215.974010] usb 1-1: new high-speed USB device number 109 using xhci_hcd

olerem commented 9 years ago

The driver do not reloading itself. At some point usb layer getting "reset" or "detach" signal from hardware. After this, deinit process is starting, ath9k_htc is not needed any more since usb device is detached, so it is unloaded. Then usb layer get attach signal and the driver is loaded again. If some job was running and not stopped on driver unload, then this job will fail print some thing like this " Failed to wakeup in".

Forget about pci driver. First of all recheck the usb cable (some times we get bug reports wich are solved by other cable), test if your adapter get enough power. Please provide complete! dmesg,, compress it and send to linux ^ rempel-privat ^ de.

yipperr commented 9 years ago

i have come across many error that might be caused by something trivial like the wpa_supplicant or the network-manger i am asking this because after googling i seem to be the very few people reporting on this error can't find anyone reporting the same for the alpha awus03nha card

nothing in the openwrt forums is also a clue because of it being custom distribution should i look into network-manger doing anything strange ? or is this absurd

which linux distribution, kernel are you running with this device ? since you sound like your running a full linux distro with the same device and don't experience the problem

i just read the wiki https://github.com/qca/open-ath9k-htc-firmware/wiki/usb-related-issues

i can rule out the leds and as for the cable and power it works fine in windows with windows driver

olerem commented 9 years ago

Like i said, i use this adapter and do some stress tests on it. Some times FW may fail and reboot adapter, but in this case with updated kernel you will get some thing like this: [ 3501.052975] usb 1-2: ath: firmware panic! exccause: 0x0000000d; pc: 0x0090a641; badvaddr: 0x12345678.

Your issue looks more like this: http://www.linuxforums.org/forum/hardware-peripherals/195227-tl-wn722n-backtrack-5-a.html

olerem commented 9 years ago

Here is updated list with usb related issues: https://github.com/qca/open-ath9k-htc-firmware/wiki/usb-related-issues

feedbacks are welcome! :D

Skity commented 9 years ago

Hi, I have exactly the same issue with the same adapter than yipperr. I do it from a Raspberry Pi with the latest atheros drivers.

Linux hostname 3.18.11+ #781 PREEMPT Tue Apr 21 18:02:18 BST 2015 armv6l GNU/Linux

Are you still following this issue ? If I can help you resolve it ...

Same symptom than yipperr: Works perfectly (or almost) on Windows. Just have to reduce TX/RX buffer to 128 instead of 256 else it seems to have the same problem on Windows but Microsoft manages better it by "not disconnecting".

Do you know how to change the buffer in linux ?

olerem commented 9 years ago

i have no idea what "TX/RX buffer" means.

Skity commented 9 years ago

TX=Transmission RX=Reception

This is an option from the Windows driver. In the device properties on Windows I can change "Transmit Buffers" and "Receive Buffers"

Skity commented 9 years ago

I removed the blinked LED by doing linux $> echo none > /sys/class/leds/ath9k_htc-phy*/trigger

It seems to be better. If you don't heard of me it had worked :)

olerem commented 9 years ago

If you will update kernel and firmware, it should work even better.

Skity commented 9 years ago

They are both up to date :)

olerem commented 9 years ago

3.18.11? really?

Skity commented 9 years ago

Yop --> root@hostname:~# uname -a Linux hostname 3.18.11+ #781 PREEMPT Tue Apr 21 18:02:18 BST 2015 armv6l GNU/Linux

Skity commented 9 years ago

$> apt-cache show firmware-atheros Package: firmware-atheros Source: firmware-nonfree Version: 0.36+wheezy.1 Installed-Size: 814 Maintainer: Debian Kernel Team debian-kernel@lists.debian.org Architecture: all Suggests: initramfs-tools, linux-image Size: 495008 SHA256: 2701f035f46e043ee15d23ed6b7e9860732ee5e58a1c04c7375ff13da4776143 SHA1: ddf5a1bb05e5524faea97cc104abdf3b29c92047 MD5sum: 04d7b3f3d3e1b4367c4850763a0820f0 Description: Binary firmware for Atheros wireless cards Multi-Arch: foreign Homepage: http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git Description-md5: 5a25e0b2c609d97b2e8ae2eb46c75359 Tag: admin::hardware, hardware::TODO, role::data Section: non-free/kernel Priority: optional Filename: pool/non-free/f/firmware-nonfree/firmware-atheros_0.36+wheezy.1_all.deb

/lib/firmware # ll 9271 -rw-r--r-- 1 root root 51312 Jan 6 2013 ar9271.fw -rw-r--r-- 1 root root 51272 Jan 6 2013 htc_9271.fw

$> md5sum ar9271.fw htc_9271.fw 2e6f5045ec4c5a42bb93ced242bad0ba ar9271.fw 76c902360ef8a095133258fd0d287292 htc_9271.fw

If it could help ;-)

olerem commented 9 years ago

Well.... it is very old kernel and firmware.

Skity commented 9 years ago

I can't do better I think. I'm on a Raspberry Pi with ARM architecture. Unless I build my own kernel through cross compilation, I can't go to 4.0.5.

Anyway, disabling the Led seems to solved the problem.

yipperr commented 9 years ago

@Skity in my cases the problem din't get solved with turning the led off.. it happens randomly for me where it's most frequent with access point with lower signals and less frequent with access points with higher strength

Skity commented 9 years ago

@yipperr : Try to maximize the current on your USB ports (since RPI B+) with the following options in config.txt in /boot :

safe_mode_gpio=4 max_usb_current=1

Skity commented 9 years ago

I also changed the cable by one with two output (One to the adapter and Two to the RPI to provide more power to the adapter)

yipperr commented 9 years ago

i tried the usb 3.0 port and 2.0 ports on my laptop all behaves similarly glad to see you have it fixed

Skity commented 9 years ago

@yipperr : not glad it doesn't fix it for you :) Do you have linux on your laptop ? Did you tried to purge "firmware-atheros" package and re-install it and then upgrade it ?

user113 commented 9 years ago

Advice: English no main language Hi i just created the account here because i have the same yipperr issue. I have the same device, the alfa card. Im running Debian Jessie stable version. #############################

uname -a Linux localhost 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux ############################# lsusb -v | egrep "MaxPower|Bus" Bus 003 Device 006: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n (Bus Powered) MaxPower 500mA ############################# Commands i tried to fix. echo none > /sys/class/leds/ath9k_htc-phy*/trigger Commands about power. echo "-1" > /sys/bus/usb/devices/usb3/power/autosuspend_delay_ms echo "on" > /sys/bus/usb/devices/usb3/power/control ############################# SYSLOG kernel: [ 279.532867] snd_hda_intel 0000:00:1b.0: IRQ timing workaround is activated for card #1. Suggest a bigger bdl_pos_adj. kernel: [ 323.905675] usb 3-2: USB disconnect, device number 3 kernel: [ 323.922344] wlan0: deauthenticating from xx:xx:xx:xx:xx:xx by local choice (Reason: 3=DEAUTH_LEAVING) kernel: [ 324.025457] ath: phy1: RX failed to go idle in 10 ms RXSM=0x48a1a9c6 kernel: [ 324.035503] ath: phy1: Failed to wakeup in 500us
kernel: [ 324.136105] ath: phy1: RX failed to go idle in 10 ms RXSM=0x40b36725 kernel: [ 324.146169] ath: phy1: Failed to wakeup in 500us
kernel: [ 324.246797] ath: phy1: RX failed to go idle in 10 ms RXSM=0xc892a9c6 kernel: [ 324.256787] ath: phy1: Failed to wakeup in 500us
kernel: [ 324.358372] ath: phy1: RX failed to go idle in 10 ms RXSM=0xc892a9c6 kernel: [ 324.381667] cfg80211: Calling CRDA to update world regulatory domain kernel: [ 324.383990] cfg80211: World regulatory domain updated: kernel: [ 324.383993] cfg80211: DFS Master region: unset
kernel: [ 324.383994] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) kernel: [ 324.383995] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) kernel: [ 324.383997] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) kernel: [ 324.383998] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) kernel: [ 324.383999] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) kernel: [ 324.384000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) kernel: [ 324.384001] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) kernel: [ 324.384002] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) kernel: [ 324.384004] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) kernel: [ 324.443676] usb 3-2: ath9k_htc: USB layer deinitialized kernel: [ 324.681297] usb 3-2: new high-speed USB device number 5 using xhci_hcd kernel: [ 328.948569] alx 0000:04:00.0: irq 52 for MSI/MSI-X kernel: [ 328.948899] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready kernel: [ 329.878944] usb 3-2: New USB device found, idVendor=0cf3, idProduct=9271 kernel: [ 329.878948] usb 3-2: New USB device strings: Mfr=16, Product=32, SerialNumber=48 kernel: [ 329.878950] usb 3-2: Product: UB91C kernel: [ 329.878951] usb 3-2: Manufacturer: ATHEROS kernel: [ 329.878952] usb 3-2: SerialNumber: 12345 kernel: [ 329.879408] usb 3-2: ath9k_htc: Firmware htc_9271.fw requested kernel: [ 329.879548] usb 3-2: firmware: direct-loading firmware htc_9271.fw kernel: [ 330.160798] usb 3-2: ath9k_htc: Transferred FW: htc_9271.fw, size: 51008 kernel: [ 330.412471] ath9k_htc 3-2:1.0: ath9k_htc: HTC initialized with 33 credits kernel: [ 330.677966] ath9k_htc 3-2:1.0: ath9k_htc: FW Version: 1.4 kernel: [ 330.677970] ath: EEPROM regdomain: 0x833a kernel: [ 330.677971] ath: EEPROM indicates we should expect a country code kernel: [ 330.677972] ath: doing EEPROM country->regdmn map search kernel: [ 330.677973] ath: country maps to regdmn code: 0x37 kernel: [ 330.677974] ath: Country alpha2 being used: GB kernel: [ 330.677975] ath: Regpair used: 0x37 kernel: [ 330.682429] ieee80211 phy2: Atheros AR9271 Rev:1 kernel: [ 330.682438] cfg80211: Calling CRDA for country: GB kernel: [ 330.985324] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready kernel: [ 330.985359] cfg80211: Regulatory domain changed to country: GB kernel: [ 330.985361] cfg80211: DFS Master region: ETSI kernel: [ 330.985363] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) kernel: [ 330.985365] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) kernel: [ 330.985366] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) kernel: [ 330.985368] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) kernel: [ 330.985369] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s) kernel: [ 330.985371] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) ########################## Other info: I have 3 usb on my MSI laptop, two 3.0 usb in left and one 2.0 usb in right, when i put the wifi card in the 3.0 usb port the disconections are much more often than when i use the right alone 2.0 usb port. Im reading a lot of info about the problem and the direction is about power problem in the usb port. In windows all works fine. Im using the driver you have here latest version. I had another driver the 76c902360ef8a095133258fd0d287292 htc_9271.fw and the problem was the same. TY :)

olerem commented 9 years ago

Using new firmware with old driver/kernel will not do any changes. Please update kernel.

user113 commented 9 years ago

Advice: English no main language Hi, i upgraded the kernel to debian backport 4.1.0-0.bpo.1-amd64 and im right now 3 hours without any disconnection in the usb. Seems that works :D.

olerem commented 9 years ago

If if there some disconnections, i hope it will restore within 10 seconds.

user113 commented 9 years ago

Advice: English no main language After more test (all day) i think i can say 100% that with kernel 4.1.0-0.bpo.1-amd64 there is 0 disconnections. I dont know what changes have that kernel but is fixed. Bye.

olerem commented 9 years ago

glad to hear it :)

wice22 commented 7 years ago

Not sure if u are following this but I have similar issue, but with latest kernel + firmware using: ALPHA AWUS036NHA dmesg:

[ 2076.850658] ath: phy454: Failed to wakeup in 500us
[ 2077.022912] usb 3-1: ath9k_htc: USB layer deinitialized
[ 2077.458764] usb 3-1: new high-speed USB device number 89 using ehci-pci
[ 2077.806076] usb 3-1: New USB device found, idVendor=0cf3, idProduct=9271
[ 2077.806081] usb 3-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 2077.806083] usb 3-1: Product: UB91C
[ 2077.806085] usb 3-1: Manufacturer: ATHEROS
[ 2077.806086] usb 3-1: SerialNumber: 12345
[ 2077.811670] usb 3-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[ 2077.812151] usb 3-1: firmware: direct-loading firmware ath9k_htc/htc_9271-1.4.0.fw
[ 2078.307289] usb 3-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[ 2078.576630] ath9k_htc 3-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 2079.379030] ath9k_htc 3-1:1.0: ath9k_htc: FW Version: 1.4
[ 2079.379035] ath9k_htc 3-1:1.0: FW RMW support: On
[ 2079.379037] ath: EEPROM regdomain: 0x833a
[ 2079.379039] ath: EEPROM indicates we should expect a country code
[ 2079.379041] ath: doing EEPROM country->regdmn map search
[ 2079.379042] ath: country maps to regdmn code: 0x37
[ 2079.379044] ath: Country alpha2 being used: GB
[ 2079.379045] ath: Regpair used: 0x37
[ 2079.397813] ieee80211 phy455: Atheros AR9271 Rev:1
[ 2079.423011] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 2080.325742] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 2080.371626] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 2081.341801] usb 3-1: USB disconnect, device number 89
[ 2083.284344] ath: phy455: Failed to wakeup in 500us

It try's to reconnect again and again,

uname -r 4.6.0-kali1-amd64

apt-cache show firmware-atheros

Package: firmware-atheros
Source: firmware-nonfree
Version: 20161130-2
Installed-Size: 8047
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Architecture: all
Suggests: initramfs-tools
Size: 3131328
SHA256: b1bb504275339f6218eb307bcddfb4f2bdb709d18ce9cc2333d04bc3b0a00875
SHA1: 54e11f24724bd76e33d5906f09698c4de72f9cb2
MD5sum: 54df1d1d7530cbe1cc1b134c6db484a0
Description: Binary firmware for Atheros wireless cards
 This package contains the binary firmware for USB wireless network and
 Bluetooth cards supported by the ar5523, ath3k, ath6kl_sdio, ath6kl_usb,
 ath9k_htc or ath10k drivers.
 .
 Contents:
.................................
  * ath6k/AR6004/hw1.3/fw-3.bin
  * Atheros AR7010 firmware, version 1.4.0 (ath9k_htc/htc_7010-1.4.0.fw)
  * Atheros AR9271 firmware, version 1.4.0 (ath9k_htc/htc_9271-1.4.0.fw)
  * Atheros AR7010 firmware, version 1.3.1 (htc_7010.fw)
  * Atheros AR9271 firmware, version 1.3.1 (htc_9271.fw)
  * Qualcomm Atheros QCA61x4 version 3.0 UART BT NVM configuration
    (qca/nvm_00130300.bin)
...............................
Description-md5: cc64d612094e73015861cf2915345869
Multi-Arch: foreign
Homepage: https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git
Tag: admin::hardware, role::app-data, use::driver
Section: non-free/kernel
Priority: optional
Filename: pool/non-free/f/firmware-nonfree/firmware-atheros_20161130-2_all.deb
olerem commented 7 years ago

@wice22, please read: https://github.com/qca/open-ath9k-htc-firmware/wiki/usb-related-issues

wice22 commented 7 years ago

I did change the cable to a proper (with filter) + shorter one, no additional powering was need cause I'm connecting it to 3.0 interface, (2.0 may need some extra powering) then shutdown -r now and wuala :

4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:c0:ca:84:d3:ae brd ff:ff:ff:ff:ff:ff

dmesg

[  583.026125] usb 1-1: new high-speed USB device number 4 using ehci-pci
[  583.376076] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271
[  583.376081] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[  583.376083] usb 1-1: Product: UB91C
[  583.376085] usb 1-1: Manufacturer: ATHEROS
[  583.376086] usb 1-1: SerialNumber: 12345
[  583.383559] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[  583.383802] usb 1-1: firmware: direct-loading firmware ath9k_htc/htc_9271-1.4.0.fw
[  583.874046] usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[  584.154669] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits
[  585.307551] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.4
[  585.307555] ath9k_htc 1-1:1.0: FW RMW support: On
[  585.307557] ath: EEPROM regdomain: 0x833a
[  585.307559] ath: EEPROM indicates we should expect a country code
[  585.307560] ath: doing EEPROM country->regdmn map search
[  585.307561] ath: country maps to regdmn code: 0x37
[  585.307563] ath: Country alpha2 being used: GB
[  585.307564] ath: Regpair used: 0x37
[  585.337764] ieee80211 phy2: Atheros AR9271 Rev:1
[  585.367485] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  586.704907] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  586.766264] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

Thanks @olerem

psyborg55 commented 5 years ago

i've had this problem too with alfa card, especially if enabled more channels e.g. 2.3-2.7GHz. eventually it's reception sensitivity went bad showing 12-15dB less signal. after replacing faulty T/R switch it now works without problems with even wider range set (2192-2992) and i noticed no more disconnects. so, most likely it is hardware fault

erikarn commented 5 years ago

Yeah, the hardware isn't designed for 2.3-2.7, so a bunch of weird crap can go wrong. Sorry :(

-a

On Sun, 13 Jan 2019 at 15:08, psyborg55 notifications@github.com wrote:

i've had this problem too with alfa card, especially if enabled more channels e.g. 2.3-2.7GHz. eventually it's reception sensitivity went bad showing 12-15dB less signal. after replacing faulty T/R switch it now works without problems with even wider range set (2192-2992) and i noticed no more disconnects. so, most likely it is hardware fault

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/qca/open-ath9k-htc-firmware/issues/72#issuecomment-453874399, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGl7UWYR74fT6EcPdK_kFM9YP-qOSDEks5vC7yBgaJpZM4DgtiY .

psyborg55 commented 5 years ago

no such crap with tl-wn722

TheMrRandomDude commented 4 years ago

@psyborg55 Hey psyborg. Can confirm, same issue. Would lenght of USB cable matter? I've put some shielding on mine and a ferrite bead.

psyborg55 commented 4 years ago

first, try using cable other than the one you got in package (suggestion 50cm or shorter) if it still doesn't work, enable debug on linux system and post output here

TheMrRandomDude commented 4 years ago

@psyborg55 Tried multiple cables too, didn't work. I thought that it might require more power and ask for a powered hub, but I saw people using it on Youtube with a regular old 2.0 USB. It should work normally.

By debug I suppose you meant my dmesg output? I hope I got it right. Thank you so much once again

dmesg

https://pastebin.com/T0Cg6SpW

psyborg55 commented 4 years ago

try to get full debug output, by passing debug parameter to driver. e.g. on my system it is in /etc/modprobe.d/ath9k.conf options ath9k_htc debug=0xffffffff

Hackndo commented 4 years ago

@psyborg55 Thank you for suggesting a cable change. I was trying to debug @TheMrRandomDude exact same issue with my card, and other cards, on multiple OS, virtualbox, live USB and so on. Then I read your answer, tried a new cable, and now it works like a charm.

Apteryks commented 9 months ago

8 years later, I'm seeing this error on a Lenovo X200 laptop running Guix System. It renders my ThinkPenguin TP150N dongle unusable:

[ 1862.993642] usb 5-2: ath9k_htc: Firmware htc_9271.fw requested
[ 1863.279534] usb 5-2: ath9k_htc: Transferred FW: htc_9271.fw, size: 51008
[ 1863.530405] ath9k_htc 5-2:1.0: ath9k_htc: HTC initialized with 33 credits
[ 1863.800067] ath9k_htc 5-2:1.0: ath9k_htc: FW Version: 1.4
[ 1863.800076] ath9k_htc 5-2:1.0: FW RMW support: On
[ 1863.800079] ath: EEPROM regdomain: 0x65
[ 1863.800081] ath: EEPROM indicates we should expect a direct regpair map
[ 1863.800084] ath: Country alpha2 being used: 00
[ 1863.800085] ath: Regpair used: 0x65
[ 1863.804853] ath: EEPROM regdomain: 0x807c
[ 1863.804860] ath: EEPROM indicates we should expect a country code
[ 1863.804862] ath: doing EEPROM country->regdmn map search
[ 1863.804863] ath: country maps to regdmn code: 0x3a
[ 1863.804865] ath: Country alpha2 being used: CA
[ 1863.804867] ath: Regpair used: 0x3a
[ 1863.804868] ath: regdomain 0x807c dynamically updated by country element
[ 1863.805298] ieee80211 phy3: Atheros AR9271 Rev:1
[ 1863.833030] ath9k_htc 5-2:1.0 wlp0s29f7u2: renamed from wlan0
[ 1870.071792] usb 5-2: USB disconnect, device number 11
[ 1870.133299] ath: phy3: Failed to wakeup in 500us
[ 1870.143484] ath: phy3: Failed to wakeup in 500us
[ 1870.199311] usb 5-2: ath9k_htc: USB layer deinitialized
[ 1870.471414] usb 5-2: new high-speed USB device number 12 using ehci-pci
[ 1870.819202] usb 5-2: device descriptor read/64, error -71
[ 1872.595141] usb 5-2: device descriptor read/64, error -71
[ 1873.967477] usb 5-2: new high-speed USB device number 13 using ehci-pci
[ 1874.811473] usb 5-2: device descriptor read/64, error -71
[ 1875.275477] usb 5-2: device descriptor read/64, error -71
[ 1875.383538] usb usb5-port2: attempt power cycle
[ 1875.875438] usb 5-2: new high-speed USB device number 14 using ehci-pci
[ 1876.303477] usb 5-2: device not accepting address 14, error -71
[ 1877.143475] usb 5-2: new high-speed USB device number 15 using ehci-pci
[ 1877.571406] usb 5-2: device not accepting address 15, error -71
[ 1877.571497] usb usb5-port2: unable to enumerate USB device
[ 1877.835381] usb 6-2: new full-speed USB device number 3 using uhci_hcd
[ 1878.021406] usb 6-2: not running at top speed; connect to a high speed hub
[ 1878.052199] usb 6-2: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= 1.08
[ 1878.052221] usb 6-2: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 1878.052228] usb 6-2: Product: UB93
[ 1878.052235] usb 6-2: Manufacturer: ATHEROS
[ 1878.052241] usb 6-2: SerialNumber: 12345
[ 1878.056376] usb 6-2: ath9k_htc: Device endpoint numbers are not the expected ones

Since the e1000e wired ethernet also appears to be flaky on that X200, I don't have connectivitity at the moment, so I wasn't able to upgrade the OS to see if it would help things. I'll try later using USB tethering.

psyborg55 commented 9 months ago

the error is most of the time caused by hw power fault. windows drivers might work just fine, but if you get this in every linux version with any kernel you try it is hw issue. sometimes using shorter cable might help, if not you need to repair device. i'm in the process of repairing my alfa card that got busted pretty well, atm works fine in windows, but these same disconnects happen in linux - on devices and OS versions it used to work fine with, before it got damaged

@olerem @erikarn in the datasheet, section LDO Circuit Recommendation recommended capacitance for 1.2V supply is 10 to 33uF is this only for on-chip LDO design ?

suggestion there "If the on-chip LDO is not used, the CTRL1 pin should be pulled down to ground by 10 kohm resistor to disable the internal amplifier."

alfa does not use on-chip LDO, and it also looks like the pin is left floating. is there a sw way of disabling internal amp ? and 1.2V supply is filtered with a single 10uF capacitor, maybe it is tight and there should be more?

Apteryks commented 9 months ago

@psyborg55 I tried it from another Guix System laptop, and I had a different USB error but it also would not work, so your theory of a HW issue seems plausible. It's the first time I experienced such failure from this kind of electronic though, so I'm surprised. My adapter uses the AR9271 chipset (see: https://www.thinkpenguin.com/gnu-linux/penguin-wireless-n-usb-adapter-gnu-linux-tpe-n150usb).

Here's what dmesg reported on that 2nd machine:

[3192018.949554] usb 1-3.4: USB disconnect, device number 18
[3194527.928652] usb 1-3.4: new high-speed USB device number 19 using ehci-pci
[3194528.053552] usb 1-3.4: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= 1.08
[3194528.053561] usb 1-3.4: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[3194528.053565] usb 1-3.4: Product: UB93
[3194528.053568] usb 1-3.4: Manufacturer: ATHEROS
[3194528.053571] usb 1-3.4: SerialNumber: 12345
[3194528.133351] usb 1-3.4: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[3194528.134020] usbcore: registered new interface driver ath9k_htc
[3194528.134435] usb 1-3.4: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[3194528.134442] usb 1-3.4: ath9k_htc: Firmware htc_9271.fw requested
[3194528.416180] usb 1-3.4: ath9k_htc: Transferred FW: htc_9271.fw, size: 51008
[3194528.665054] ath9k_htc 1-3.4:1.0: ath9k_htc: HTC initialized with 33 credits
[3194528.938933] ath9k_htc 1-3.4:1.0: ath9k_htc: FW Version: 1.4
[3194528.938941] ath9k_htc 1-3.4:1.0: FW RMW support: On
[3194528.938945] ath: EEPROM regdomain: 0x65
[3194528.938947] ath: EEPROM indicates we should expect a direct regpair map
[3194528.938951] ath: Country alpha2 being used: 00
[3194528.938953] ath: Regpair used: 0x65
[3194528.943312] ath: EEPROM regdomain: 0x807c
[3194528.943318] ath: EEPROM indicates we should expect a country code
[3194528.943320] ath: doing EEPROM country->regdmn map search
[3194528.943323] ath: country maps to regdmn code: 0x3a
[3194528.943325] ath: Country alpha2 being used: CA
[3194528.943327] ath: Regpair used: 0x3a
[3194528.943329] ath: regdomain 0x807c dynamically updated by country element
[3194528.946802] ieee80211 phy1: Atheros AR9271 Rev:1
[3194528.966927] ath9k_htc 1-3.4:1.0 wlp0s29f7u3u4: renamed from wlan0
[3194545.926308] usb 1-3.4: USB disconnect, device number 19
[3194546.244709] ath: phy1: Failed to wakeup in 500us
[3194546.254732] ath: phy1: Failed to wakeup in 500us
[3194546.301440] usb 1-3.4: ath9k_htc: USB layer deinitialized
psyborg55 commented 9 months ago

yeah, slightly different set of messages, only host dependent. USB disconnect, device number followed by Failed to wakeup is in common to devices with some sort of hw failure. in my case i also get "RX failed to go idle" now waiting for parts to arrive, i will update here if the replacement solved the problem for me

psyborg55 commented 8 months ago

i restored my awus036nha fully. no more any of these messages with old laptop and two routers. parts that needed replacement (except for richtek power converter) are VLS252012ET-2R2M and only one was faulty (1.2V i guess) according to LCR measurement. also tried to use parts from mq4wu5108 card but these did not work, i think they are of different value than 2.2uH

Apteryks commented 8 months ago

@psyborg55 just to be clear, you needed to replace 1. richtek power converter integrated circuit (which model?) 2. one of the two VLS252012ET-2R2M, right?

For other readers, the VLS252012Et-2R2M part is a 2.2 uH surface mounted inductor (see: https://product.tdk.com/system/files/dam/doc/product/inductor/inductor/smd/catalog/inductor_automotive_power_vls252012e-ca_en.pdf)

psyborg55 commented 8 months ago

yes, those were busted completely. it is RT8020GQW. visually, they looked fine, but the richtek was getting extremely hot just seconds after plugging in and voltages were bad. inductor was quite difficult to detect, tx/rx rates would drop to 108/120 Mbps - i took off almost all capacitors and checked only to find they all appear to be fine. then i replaced the inductor with the one from mq4wu5108 board, rates synced at 150/150 but there were still some issues. LCR confirmed original 2.2uH inductor went down to 0.3uH, the other inductor was good, the two inductors from mq4wu5108 card have more than 2.2uH (can't tell precisely as the measurement was with 2-wire) and one of these two has slightly higher inductance than the other one - about 0.1uH. at that point i decided to buy new TDK inductors and after soldering both new parts everything works fine (probably it would work fine if i replaced only the damaged one, but as they come in pack of 10 why not change both) AR9271 got damaged too (about 0.7w higher power consumption) but continued to work so i replaced it as well (put it on my tl-wn722 that i used entire time) i also replaced SE2576 power amp, but it appears that one wasn't damaged