Bug 57341 - ath9k_htc device don't recover after warm reset or module reload
Summary: ath9k_htc device don't recover after warm reset or module reload
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-30 21:26 UTC by Andy Ross
Modified: 2019-04-11 12:05 UTC (History)
7 users (show)

See Also:
Kernel Version: 3.8
Subsystem:
Regression: No
Bisected commit-id:


Attachments
wifi not working after getting a new fw (1.38 KB, text/plain)
2014-09-28 22:05 UTC, Martin Dratva
Details
Requested output of lspci (10.39 KB, text/plain)
2014-10-25 16:00 UTC, Martin Dratva
Details
Requested output of lsusb (1.36 KB, text/plain)
2014-10-25 16:00 UTC, Martin Dratva
Details
Dmesg after resume (77.86 KB, text/plain)
2014-10-25 16:01 UTC, Martin Dratva
Details
Dmesg after resume and reinsert of adapter (80.99 KB, text/plain)
2014-10-25 16:02 UTC, Martin Dratva
Details

Description Andy Ross 2013-04-30 21:26:05 UTC
If a ath9k_htc device is on the USB bus and functioning, a module reset (either by warm-booting the machine, or by rmmod/insmod'ing the ath9k_htc.ko module) causes the device to stop responding.  Apparently once loaded, the firmware will not permit a reload of new firmware (done unconditionally by the driver) without a power cycle.

This issue was submitted originally to the open source firmware project for these devices (note that the same bug is present in the proprietary firmware build still used in linux-firmware, not just in builds from the free project which descends from the same code):

https://github.com/qca/open-ath9k-htc-firmware/issues/1

There is some argument as to which side of the USB connection the issue should be fixed on, but it's quite real.
Comment 1 Oleksij Rempel 2013-11-08 18:33:28 UTC
Is this bug still reproducable?
Comment 2 Christian Stadelmann 2014-06-15 19:40:21 UTC
For me this bug is not reproducable (Kernel 3.14.6 from Fedora 20 x86_64)
Comment 3 Martin Dratva 2014-09-27 07:57:42 UTC
I am not sure if this is the same issue, but I see this:
[10738.012037] ath9k_htc 1-2.4:1.0: ath9k_htc: Target is unresponsive
[10738.012058] ath9k_htc: Failed to initialize the device

in recent kernels (currently 3.16.3) after I wake up my PC from sleep. I have to manually disconnect my USB adapter and connect it back to get it working.
Comment 4 Oleksij Rempel 2014-09-27 09:54:41 UTC
Is it working with latest firmware?
https://github.com/olerem/ath9k-htc-firmware-blob
Comment 5 Martin Dratva 2014-09-28 22:05:58 UTC
Created attachment 152051 [details]
wifi not working after getting a new fw
Comment 6 Martin Dratva 2014-09-28 22:07:29 UTC
I have downloaded htc_9271.fw from the link you provided and copied it to /usr/lib/firmware. After that, my wifi did not work at all. See attached log. I am not sure, if I have not done it properly or it just does not work.
Comment 7 Oleksij Rempel 2014-09-28 22:36:20 UTC
FW size reported by kernel is incorrect:
>[   61.772881] usb 3-2.4: ath9k_htc: Transferred FW: htc_9271.fw, size: 23948
it should be 51008.
and the path should be /lib/firmware/.
Comment 8 Martin Dratva 2014-09-30 21:15:20 UTC
I tried again and this time I got expected fw size. It works fine, but the issue after waking up from sleep is still there. 

p.s. On my system (Arch Linux) /lib is symlink to /usr/lib/
Comment 9 Oleksij Rempel 2014-10-01 05:08:56 UTC
Hi Martin,

can you please test latest branch:
https://git.kernel.org/cgit/linux/kernel/git/linville/wireless-testing.git/

I can't reproduce this suspend/resume issue on my laptop. It is just working.

If it is working with latest source, then ok. If not, and this issue is regression (worked on some version before), then please try to make "git bisect". In this case i would assume, this issue was coused by usb subsystem and not by wireless driver.
Comment 10 Martin Dratva 2014-10-10 19:17:46 UTC
I think this is a bit beyond my capabilities, I don't know how to do that.
Comment 11 Oleksij Rempel 2014-10-11 07:36:50 UTC
What kind of USB host controller do you have? Is it a USB port with charging support? Usually it is easy to recognise by always working usb mouse, even is sleep mode.
If it is the case, can you please try different port.
Comment 12 Martin Dratva 2014-10-11 08:51:03 UTC
I have it connected to my monitor, which does not have powered hub, but I switched it to USB directly on my PC, which is powered (double checked that, my phone was charging while connected) and the result is the same.
Comment 13 Oleksij Rempel 2014-10-14 12:18:19 UTC
I tested ar9271 on 3 different usb controllers, kernel version 3.17, still can't reproduce it.
Comment 14 Martin Dratva 2014-10-14 12:20:30 UTC
Would my HW info help? What exactly do you need to identify the HW I do run, lspci?
Comment 15 Oleksij Rempel 2014-10-14 12:23:39 UTC
"lspci -v" to know which usb controller do you use.
"lsusb -t" to see where is this adapter attached.
complete dmesg, after suspend resume.
Comment 16 Martin Dratva 2014-10-14 20:43:01 UTC
Strange thing is that I can not reproduce it at the moment. But I will keep an eye on it and once it happens again, I will post the required data. 
It was happening all the time before.
Comment 17 Martin Dratva 2014-10-25 16:00:29 UTC
Created attachment 155011 [details]
Requested output of lspci
Comment 18 Martin Dratva 2014-10-25 16:00:57 UTC
Created attachment 155021 [details]
Requested output of lsusb
Comment 19 Martin Dratva 2014-10-25 16:01:21 UTC
Created attachment 155031 [details]
Dmesg after resume
Comment 20 Martin Dratva 2014-10-25 16:02:33 UTC
Created attachment 155041 [details]
Dmesg after resume and reinsert of adapter

After removing the USB adapter and reattaching it, wifi works again.
Comment 21 Oleksij Rempel 2014-10-25 16:25:43 UTC
This is log with old firmware, version 1.3. Did you tested it with latest firmware? The link i provided you?
Comment 22 Martin Dratva 2014-10-25 16:38:13 UTC
Yes, I have tested it with the FW you provided and the result was the same.
Comment 23 Oleksij Rempel 2014-10-25 17:10:16 UTC
Please send dmesg with new firmware.
Comment 24 Thomas Lindroth 2019-04-11 12:05:36 UTC
I still experience this problem but all my googling only result in posts from 2013 indicating that the problem is solved. I case someone comes across this bug report while googling like I did I just want to share how I managed to work around the problem.

Here is what I did:
1. Boot a 4.14.105 kernel
2. Plug in an ath9k_htc based usb dongle and let the 9271 firmware load successfully
3. Bring up the interface with ifconfig wlan0 up and use it
4. Bring down the interface with ifconfig wlan0 down
5. Hibernate the system
6. After resume the "Target is unresponsive"

The dongle is now in a wedged state and only a usb replugging can bring it back.

The problem turned out to be step 4. If I hibernate without doing ifconfig down the dongle works fine after resume. It's probably some residual bug in the driver.

The reason why I used ifconfig down is because I sometimes use a iwlwifi based device and hibernation always fails unless I first bring the interface down.

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